Created
February 16, 2016 01:15
-
-
Save armandofox/60a85a64799ea238c045 to your computer and use it in GitHub Desktop.
edit_update.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in movies_controller.rb | |
def edit | |
@movie = Movie.find params[:id] | |
end | |
def update | |
@movie = Movie.find params[:id] | |
@movie.update_attributes!(params[:movie]) | |
flash[:notice] = "#{@movie.title} was successfully updated." | |
redirect_to movie_path(@movie) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To avoid ForbiddenAttributesError: