Skip to content

Instantly share code, notes, and snippets.

View Abhishek-Ravichandran's full-sized avatar

Abhishek-Ravichandran

View GitHub Profile
@Abhishek-Ravichandran
Abhishek-Ravichandran / edit_update.rb
Last active December 7, 2016 05:30 — forked from armandofox/edit_update.rb
edit_update.rb
# in movies_controller.rb
def edit
@movie = Movie.find params[:id]
end
def update
@movie = Movie.find params[:id]
permitted = params[:movie].permit(:title, :rating, :description, :release_date)
@movie.update_attributes!(permitted)