What's the preferred way to issue a 404 response from a rails controller action?
+3
A:
This seems good...
render :file => "#{RAILS_ROOT}/public/404.html", :status => 404
Jason Punyon
2009-04-23 00:35:47
+4
A:
render :file => '/path/to/some/filenotfound.rhtml',
status => 404, :layout => true
tvanfosson
2009-04-23 00:36:26
This is a little nicer...
Jason Punyon
2009-04-23 00:38:02
A:
In the ApplicationController define a method like:
def render_404
render :file => "#{RAILS_ROOT}/public/404.html", :status => 404
end
huacnlee
2009-04-24 07:33:01