Steve Ross wrote:
> I don't understand why you can't use a stylesheet like:
> 
> application.css
> 
> that handles the general case or "default theme", as you refer to it, 
> and then simply serve up a second stylesheet after that based on 
> preference, as:
> 
> <%= stylesheet_link_tag :application %>
> <%= stylesheet_link_tag @user_theme_stylesheet if @user_theme_stylesheet 
> %>
> 
> You can then simply implement a before filter in your controller that 
> sets @user_theme_stylesheet based on user preference and relies on the 
> CSS proximity rule disambiguation to decide what CSS rule to apply.
> 
> Have I misunderstood your problem?

Yes, it's not that simple.  My problem isn't with CSS directly.  My 
problem lays simply in delivering up the paths to the css files, and the 
js files, and the swf files, and the image files, and the layout files - 
depending on what theme is set as the default theme for the site.

I no longer have these issues thanks to Fred.

I already have a layouts system implemented where based on any given 
theme, a user can decide on exactly what layout to use for every single 
page or grouped by controller type.  It's very detailed but it works 
great.

The only issues I had that were remaining were handling of images, css, 
js, and swfs, relative to the path of the theme and still have the 
ability for rails to manage these assets.

I've tested out the new code and it works great.  The assets and 
timestamps are working properly for root path and for the theme path.

So, I'm able to do the following:

http://gist.github.com/278365

==============

When a user goes to administrative options and selects what theme they 
want to use, the entire path to all assets changes for each theme (which 
includes layouts, images, javascript, stylesheets, and swfs) while none 
of MVC templates are affected.

This is what I wanted to do and it's working now 100%.  I'm just 
cleaning up the code and making it more practical and dry.

I'll revisit with some code once I'm finished.

-- 
Posted via http://www.ruby-forum.com/.
-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to