Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you issue a 404 response from a rails controller action?

What's the preferred way to issue a 404 response from a rails controller action?

like image 824
readonly Avatar asked Apr 23 '09 00:04

readonly


1 Answers

This seems good...

# Rails 2 and below render :file => "#{RAILS_ROOT}/public/404.html",  :status => 404  # Rails 3 and up render :file => "#{Rails.root}/public/404.html",  :status => 404 
like image 138
Jason Punyon Avatar answered Oct 11 '22 12:10

Jason Punyon