yeyicheng

Untitled

May 6th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.25 KB | None | 0 0
  1.     def edit    #index
  2.         @post = Post.find(params[:id])
  3.     end
  4.    
  5.     def update
  6.         @post = Post.find(params[:id])
  7.        
  8.         if @post.update_attributes(params[:post])
  9.             redirect_to posts_path, :notice => "Post has been updated."
  10.         else
  11.             render "edit"
  12.         end
  13.     end
Advertisement
Add Comment
Please, Sign In to add comment