Saraswathy Renuga
Saraswathy Renuga

Reputation: 182

Rails 3 ActionView::Template::Error: ActionView::Template::Error

I am upgrading my application from Rails 2.3.14 to Rails 3.0.1

I always get this error if there is any error in the view

Development mode eh? Here is the error - #<ActionView::Template::Error: ActionView::Template::Error>
app/controllers/application_controller.rb:158:in `render_500'

This is the code written for render_500 in application_controller.rb

def render_500(error)
 if Rails.env.production?                  
   render :file => Rails.root.join('public','access_denied.html'), :status => 500
 else      
   raise Exception, I18n.t('str_error')+" - #{error.inspect}"
 end
end

I am debugging the code now by writing puts statements.

Please help me with a solution. Thanks in advance.

Upvotes: 0

Views: 153

Answers (1)

MurifoX
MurifoX

Reputation: 15109

Well, the application is behaving properly. The Development mode eh? Here is the error is the string inside I18n.t('str_error'). You are just raising an exception, and rendering nothing, just this string, so there is no problem.
Template error can be many things, but the one more common is assets that are not precompiled and stuff. Do a little research on this, maybe it is the problem, but keep in mind that the code provided is working as expected.

Upvotes: 1

Related Questions