Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. # example_controller.rb
  2.  
  3. # Insert at top of controller
  4. before_action :set_example, only: [:show, :edit, :update, :destroy]
  5.  
  6. # Insert at end of controller
  7. private
  8.  
  9. def set_example
  10. @example = Example.find(params[:id])
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement