Rails 3 - Customizing the Error & 404 pages

前端 未结 4 1449
闹比i
闹比i 2021-02-02 09:13

I\'m building a Rails 3 app on Heroku. Right now my error pages and 404 page are all standard rails/heroku pages.

I\'d like to customize these two. Have a page for an er

4条回答
  •  花落未央
    2021-02-02 10:11

    Well rails3 still uses the same 404.html, 422.html and 500.html in the public folder. You can customize those.

    If you're talking about actually catching these exceptions, and doing some dynamic stuff, I think the basic functionality is the same, have some around_filter that catches your particular exception in application_controller ie ActiveRecord::RecordNotFound and do something with that.

提交回复
热议问题