Update: I changed the svn URL to point to it's new home!
Currently, to add support for themes into your rails application, you have to install the theme_generator. The generator will then create the folder structure for themes, and it also creates the plugin files for theme support in rails.
The more I've thought about it, the less I like this approach. I'd rather have a fully encapsulated plugin that would add support for themes into rails and define a simple generator that would merely create the boilerplate theme structure.
To that end, I present the Rail Theme Support plugin. To install the plugin execute the following in the root of your application (requires rails 0.14.3+):
./script/plugin install http://mattmccray.com/svn/rails/plugins/theme_support
In the next couple of days I'll have a trac installation up and running for it too.
You can, of course, still get the theme_generator from RubyForge. But I think the plugin will be the approach I will recommend moving forward.
Try it out and let me know what you think!
You can download a zip of the plugin at the development site homepage.
I'm also getting this with the pure plugin version if I try and send mail from the app. The gem version seems to work fine though.
I'm guessing that the pure plugin tries to patch actionview in a way that mailer does not like?!
When it comes to caching, themes and translations need some interweaving so that various translations can be cached. It's almost like a translation is a sub-theme, or variation on a theme.
I'd like to help work on a method to provide translations built into the the theme framework... Contact me at: mortonda @ dgrmm.net if you are interested in this approach...
I have the same error with ActionMailer::Base.
NoMethodError: undefined method `current_theme' for #
----
MailContactRequest is a model :
class MailContactRequest
I have the same error with ActionMailer::Base.
NoMethodError: undefined method `current_theme' for #
MailContactRequest is a model :
class MailContactRequest
I have the same error with ActionMailer::Base.
NoMethodError: undefined method `current_theme' for #
MailContactRequest is a model extend ActionMailer::Base.
MailContactRequest.create_new() send a mail, and use template to format this.
The error raise in actionview_ex.rb at line 16 (controller.current_theme), controller is a MailContactRequest object, and not a ActionController.
This error is resolved if extend ActionMailer::Base to support themes.
is why we would like to invite you to register yourself and your
blog at RubyCorner, a directory of Ruby related blogs:
http://www.rubycorner.com/
We like to think about RubyCorner as a "meeting place" for the
community, also as a "focal point" where the people new to this
technology can quickly tune into the pulse of the community.
Registering your blog will help build a valuable resource for
this growing community.
Thanks.
How can i "extend ActionMailer::Base to support themes"? (I'm a newbie to RoR)
So I changed :filename to *filename on lines 26, 27, 28 of routeset_ex.rb and put params[:filename] = File.join(params[:filename]) one line after "def stylesheets", "def javascript" and "def images".
I'm using Rails 1.1.2
- restart the server to register the plugin
- ensure that the views/layouts/[default].rhtml exists so that it can be overriden
Leave a comment...