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

ActionMailer Previews are not accessible #553

Closed
nunosilva800 opened this issue Dec 3, 2014 · 4 comments
Closed

ActionMailer Previews are not accessible #553

nunosilva800 opened this issue Dec 3, 2014 · 4 comments

Comments

@nunosilva800
Copy link

With Rails 4.1 we now have mailer previews (http://edgeguides.rubyonrails.org/4_1_release_notes.html#action-mailer-previews), but I'm getting a 404: ActionController::RoutingError (Page not found)

Commenting comfy_route :cms, :path => '/', :sitemap => true in routes.rb works, so this is means sofa is blocking access to it.

@nunosilva800
Copy link
Author

Note: also tried
config.railties_order = [ :all, ComfortableMexicanSofa::Engine ]
without success.

https://github.com/comfy/comfortable-mexican-sofa/wiki/How-to-protect-other-engines-from-catch-all-route

@GBH
Copy link
Member

GBH commented Dec 3, 2014

I don't know how mailer preview routing works, but I'm guessing it gets clobbered by the catch-all route.
I'd start digging to figure out how ActionMailer injects routes for preview. If anything, it should be possible to redefine it for your app.

Edit: Also, also that wiki is not relevant for newer versions of CMS where you define globbing routing manually. Before CMS routing was magically injected and sometimes it would make your own routes inaccessible. So I'm thinking that ActionMailer magically injects routes at the end of your app routes. So any globbing route will break it.

@GBH
Copy link
Member

GBH commented Dec 3, 2014

Yeah, it's Rails thing: rails/rails#17895

For now you can just redefine those routes before the CMS content serving route.

@nunosilva800
Copy link
Author

Cool, thanks!

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

2 participants