Skip to content

Instantly share code, notes, and snippets.

Avatar

Abhishek-Ravichandran

View GitHub Profile
View 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)