how to change theme in rails 3.2.7

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.

Jordon Bedwell wrote in post #1073894:

Depending on what it has in it, what I would do is turn it into a template in the folder of the controller and just add a manual render at the bottom of the controller that triggers based on the theme. So if your controller is UserController and the theme is theme1 then I would make theme1/index.html into app/views/user/theme1.erb and then do render :theme1 in the controllers action. Though at the point I don’t know what you would need mustache/handlebar for unless it’s entirely Ajax.