How to render two different Error page for same error code (e.g. 404) in rails?
===

I am having one rails application in which I have two sections,so I want to use two different layout for the Error page.

E.g. - If error is coming from Section 1 then layout1 / different page  should be used for the Error (404, 500).

If error is coming from Section 2 then layout2 / different page  should be used for the Error (404, 500).

I've written code to define the Error page ,enabled with erb and ruby code.

in application.rb
config.exceptions_app = self.routes

in routes.rb
match "/404", :to => "errors#error_404"
match "/500", :to => "errors#error_500"

Thanks,
gsoni

