Pregunta

I want to display the error message from any ActionView::Template::Error in my views.

I have those error messages only in my terminal like:

ActionView::Template::Error (No route matches {:controller=>"transactions", :action=>"download", :id=>nil})
¿Fue útil?

Solución

Have you tried this?

begin
  ...
rescue Exception => ex
  @message = ex.message
  render "error"
end

error is a view containing just a single line: error.html.erb

<%= @message %>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top