documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Avoid method missing when using include_stylesheets in mailer templates #224

Closed unicornrainbow closed 12 years ago

unicornrainbow commented 12 years ago

Using include_stylesheets in a mailer view raises an exception because ActionMailer::Base doesn't respond to params but should_package? expects it to. This adds a check to make sure the class responds to params.

Note: In general, including stylesheets in a mailer view isn't a good idea, but thanks to the roadie gem which automatically inlines styles, this makes more sense.

unicornrainbow commented 12 years ago

I'm closing this for now, because, after testing, this doesn't actually fix the problem for some reason I haven't pinpointed and don't have time to look into further at the moment.

As a work around, I've added a params method to ActionMailer::Base which returns an empty hash. A fix for this however would still be great.