Advertisement
saasbook

A simple edit/update action pair

Feb 2nd, 2012
2,652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.26 KB | None | 0 0
  1.   def edit
  2.     @movie = Movie.find params[:id]
  3.   end
  4.   def update
  5.     @movie = Movie.find params[:id]
  6.     @movie.update_attributes!(params[:movie])
  7.     flash[:notice] = "#{@movie.title} was successfully updated."
  8.     redirect_to movie_path(@movie)
  9.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement