Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom section partials not found in view path #10

Closed
pdobb opened this issue May 13, 2011 · 7 comments
Closed

custom section partials not found in view path #10

pdobb opened this issue May 13, 2011 · 7 comments
Assignees
Milestone

Comments

@pdobb
Copy link

pdobb commented May 13, 2011

This guy explains the issue nicely: http://stackoverflow.com/questions/5389754/custom-partials-in-exception-notification-in-rails-3

But basically, the view path for the gem seems to be specific to the gem's location and does not consult the app's view path. Is there any help for this or am I just doing it wrong perhaps?

I tried adding a section called highlights to options[:sections] and started receiving the error:

Missing partial exception_notifier/highlights with {:locale=>[:en], :handlers=>[:rjs, :rhtml, :rxml, :erb, :builder], :formats=>[:text]} in view paths "C:/Ruby187/lib/ruby/gems/1.8/gems/exception_notification-2.4.0/lib/exception_notifier/views"

Thanks

@dukejones
Copy link

I ran across this as well. Thanks for that link. Here is user Nel's excellent fix:

Just add to your initializer

ExceptionNotifier::Notifier.prepend_view_path File.join(Rails.root, 'app/views')

@gucki
Copy link

gucki commented Jun 23, 2011

I ran into this as well - should be fixed asap :)

@ghost ghost assigned smartinez87 Jul 11, 2011
@smartinez87
Copy link
Owner

As per the README, "you need to inform the gem where the views are. Create an initializer called config/initializers/exception_notifier.rb with the following code:
ExceptionNotifier::Notifier.prepend_view_path File.join(Rails.root, 'app/views')".

This is the best way to do it. When the application loads the lookup_context isn't available yet, and prepending the view path on every request is out of the question. So it makes sense that in the special cases you need this, you have to add the initializer.

Patches are welcome if there's another solution to this I'm not seeing.

@smartinez87
Copy link
Owner

This commit should help in fixing this issue, please test it to see if we can close this issue for good.
bd924ab

Thanks!

@gucki
Copy link

gucki commented Aug 8, 2011

@smartinez87 Works great for me using rails.3.1.0.rc5, thanks! Please release a new gem soon :)

@smartinez87
Copy link
Owner

@pdobb, are we ok to close this issue then?

@pdobb
Copy link
Author

pdobb commented Aug 8, 2011

Yes, and thanks for the help and the nice solution!

@pdobb pdobb closed this as completed Aug 8, 2011
smartinez87 added a commit that referenced this issue Aug 9, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants