saasbook

edit_update.rb

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