padrino/padrino-contrib — pull request #6 by blakedy (2011-12-19 20:50:58+00:00)
Title: Added :views option to exception render

In my padrino application, my 404 and 500 pages are shared among all apps and located in the public folder. I accomplish this by passing the public_folder directory to the ```:views``` option in the render method in my app's error management.

```ruby
error 404 do
render "404.haml", :views => App.public_folder
end
```

This could be an invalid approach but in keeping with this approach, the exception_notifier_plugin does not support passing along a ```:views``` parameter.

I resolved the issue by adding the ```:exceptions_views``` option to the **exception_notifier.rb** file.

```ruby
def self.registered(app)
...
app.set :exceptions_layout, :layout unless app.respond_to?(:exceptions_layout)
app.set :exceptions_views, app.views unless app.respond_to?(:exceptions_views)
app.set :redmine, {} unless app.respond_to?(:redmine)
...
app.error 500 do
...
content_type 'text/html', :charset => "utf-8"
render settings.exceptions_page, :layout => settings.exceptions_layout, :views => settings.exceptions_views
end
app.error 404 do
response.status = 404
content_type 'text/html', :charset => "utf-8"
render settings.exceptions_page, :layout => settings.exceptions_layout, :views => settings.exceptions_layout
end
end
```

Please let me know if I'm approaching this incorrectly, and if so, a link to the right approach.

Thanks,
Blake