logankoester / errship

Errship is a Rails 3.1 engine for rendering error pages inside your layout. It supports i18n, custom exceptions, and Airbrake error tracking.
http://blog.logankoester.com/errship.html
MIT License
26 stars 5 forks source link

Extending View Template? #7

Closed conradwt closed 12 years ago

conradwt commented 12 years ago

Is there an easy way to add additional content to the view template? I need to add a content_for to add content to another location with the DOM.

alexfrydl commented 12 years ago

I don't believe there is an easy way to do this without forking it yourself, but you can override which views are rendered entirely by defining render_404_error and render_error in your controller. For example:

def render_404_error(exception = nil)
  if request.format.nil? or !request.format.html? # Gracefully handles poorly-written bots and mobile clients
    head 404
  else
    render 'errors/404'
  end
end

EDIT: Woops, sorry guys. Hit Comment and Close instead of Comment.

logankoester commented 12 years ago

1 month inactive, considering this issue closed with @bfrydl's solution.