I've just checked in version 1.4 of the
theme_support plugin. It contains quite a few bugfixes and updates. This version also integrates a couple of patches from akg and D.J. Vogel. Thanks guys!
Version 1.4 adds:
- Bugfixes, of course
- Better Rails 1.1 support
- ActionMailer theme support (experimental)
- Updates to the themeitem liquid tag
- Support for theme sub-directories
- Fleshed out the Theme object to make is easy to list all of the installed Themes
As a little background, the plugin is based on the theme system developed by the Typo guys and adds support for:
- Multiple concurrent themes
- A rails generator for creating a theme folder structure
- Rake tasks for pre-caching all of the themes for increased security and performance
-
Overriding views with theme-specific rhtml or liquid templates (based on early Typo code)
- Forcing theme views to only allow liquid templates
- Made supporting themes as easy as using layouts
To install the plugin, go to your rails application root folder and run:
./script/plugin install http://mattmccray.com/svn/rails/plugins/theme_support
or, for you Windows folks:
ruby script\\plugin install http://mattmccray.com/svn/rails/plugins/theme_support
Look at the README in $/vendor/plugins/theme_support for more on implementing themes in your application.
Keep up the good work!
It seems that it does not work when using ActionMailer templates for content typing.
For example, if the mailer viewa are named order.text.html.rhtml and order.text.plain.rhtml to automatically generate multi-pert/alternative emails the plugin either generates this error...
No rhtml, rxml, or delegate template found for order_mailer/sent.text.html.rhtml
If it does not generate the error, it appears to put itself into an endless loop.
Can you confirm that this is the case? Any ideas on a fix?
Thanks, Nigel
I haven't seen this... But I didn't test for that specifically, either. I'll have a look and get back to you.
But, there's one thing. If I generated my controller with script/generate admin/pages, theme_stylesheet_link_tag will try to include /stylesheets/stylesheetname.css, instead of /themes/admin/stylesheets/stylesheetname.css .
Do you have any idea on how to solve this?
I had put: layout 'admin/admin' in my admin/pages-controller. :)
Now, there's only one thing to say: This plugin rocks!
I noticed one error in the README. It talks about the 'javascripts' directory but your plugin uses 'javascript' (plural vs. singular).
seems to be an error in line 35 of file:
http://mattmccray.com/svn/rails/plugins/theme_support/lib/theme_controller.rb
STERR.puts must be STDERR.puts
;-)
(I had some performance issue with caching in production...)
Regards.
It did however break my REST webservices that make calls like:
render :action => "list.rxml", :layout => false
I haven't plunged into the code a great deal, but i know basically actionview_ex.rb doesn't catch the original template using pick_template_extension(theme_path) and it throws the error after the loop:
ActionView::ActionViewError (No rhtml, rxml, or delegate template found for trades/list.rxml).
I got rid of the raising of this error and let the processing fall into just calling the original render file:
return __render_file(template_path, use_full_path, local_assigns)
This gave the original the chance to render the XML template and lo and behold it was able to.
Can anyone else confirm this problem?
http://jira.openqa.org/browse/SOR-1#action_13502
Here's what I'm using right now for Edge Rails:
http://pastie.caboo.se/9651
This works fine, but I also recognized that this solution can only be used once, and therefore not as scalable as I'd like.
I've been looking to investigate less-destructive methods. I'll have to try your way when I get a chance.
What can I do for this? Do I need to run some kind of rakes to precache the images?
@Matt: It would be awesome if you could fix that. Go on, this plugin is great!
Awsome plugin! It works like a charm!
There's just one thing not working - integration tests! Whenever I run an integration test, I end up with this error:
ActionView::ActionViewError (No rhtml, rxml, or delegate template found for layouts/site)
What am I missing? Should I require something from within my integration test?
Just didn't read my own code for setting the current theme very well ...
See Jonas Bengtsson's link or Chris Abad's for answer.
Note: Jonas has the solution in the comments.
Cheers,
it is here:
http://www.village-buzz.com/2007/04/30/theme-support-rails-12x-and-subversion/
Imaspy site is down. :(
I have rails 1.2.3 and I can't running this plugin
I've written an article on how to install this plugin in rails 1.2.6
You'll find it "on my blog(How to Install Theme support plugin on Rails 1.2)":http://www.webdrivenblog.com/2007/11/27/installing-the-theme-support-plugin-with-rails-1-2
Leave a comment...