Skip to content

Instantly share code, notes, and snippets.

@lkrych
Created October 17, 2016 16:25
Show Gist options
  • Save lkrych/0e0842e43a8b3e50b0475318b55fcb35 to your computer and use it in GitHub Desktop.
Save lkrych/0e0842e43a8b3e50b0475318b55fcb35 to your computer and use it in GitHub Desktop.
Read method pulled from movies_controller
class MoviesController < ApplicationController
#some code
def show
id = params[:id] # retrieve movie ID from URI route
@movie = Movie.find(id) # look up movie by unique ID
# will render app/views/movies/show.<extension> by default
end
#some code
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment