On Thursday, 30 August 2012 05:26:14 UTC-5, Ruby-Forum.com User wrote:
>
> Jordon Bedwell wrote in post #1073894: 
> > On Thursday, 30 August 2012 05:13:57 UTC-5, Ruby-Forum.com User wrote: 
> >> 
> >> 
> >>     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. 
>
>
> Thx Jordon 
>
> But where should I keep my theme1/index.html file 
>

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. 

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/GuJq_qsx2bwJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to