On Thursday, 30 August 2012 05:13:57 UTC-5, Ruby-Forum.com User wrote: > > I'm using rails 3.2.7. > > I have few themes in my public/themes folder. > For example in my theme-1 folder > there is one index.html + style.css + few images (if required) > > At the time of registration user will select one theme. Now when the > user will login that theme will display. I will use handle > bar(http://handlebarsjs.com/) for data insertion. > > My main problem is that how I'll load the theme from public/themes > folder to the user after login. > > My controller is below after user login > > class ClientUsersController < ApplicationController > > def index > > end > > end > > > Right now when user login he will redirect to index method and > index.html.erb data display to him with application.html.erb layout. > > So how I will display the theme instead of application layout. >
Store all the CSS files and image files in hierarchical (except for the stylesheets) order inside of the assets folders and then store their preference in the session and use `stylesheet_link_tag(session[:theme] || :default)` but you might add in an extra check to make sure the theme exists first I guess to prevent simple tampering. -- 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]. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/8cefqb7DF2UJ. For more options, visit https://groups.google.com/groups/opt_out.

