Guest User

Untitled

a guest
Jun 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. begin
  2. @goal = Goal.find(params[:id], :include => 'user')
  3. rescue ActiveRecord::RecordNotFound
  4. rescue_no_content
  5. end
  6.  
  7. # where
  8.  
  9. def rescue_no_content
  10. render :template => 'public/404.html'
  11. end
  12.  
  13. # Did you know?
  14. # When an ActiveRecord::RecordNotFound is raised, the 404 template is rendered by default? ¬¬
Add Comment
Please, Sign In to add comment