Skip to content

Instantly share code, notes, and snippets.

@lkrych
Created October 17, 2016 16:26
Show Gist options
  • Save lkrych/45e29b3acb744c8a62a821b0db0c0a3d to your computer and use it in GitHub Desktop.
Save lkrych/45e29b3acb744c8a62a821b0db0c0a3d to your computer and use it in GitHub Desktop.
Update method pulled from movies_controller
class MoviesController < ApplicationController
#some code
def update
@movie = Movie.find params[:id]
@movie.update_attributes!(movie_params)
flash[:notice] = "#{@movie.title} was successfully updated."
redirect_to movie_path(@movie)
end
#some code
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment