Great work Chris, this my second month in this forum and i really enjoy the series of tuts, please i'm currently working on multi tenancy application that require user to select desired theme. please how can i go about this? Thanks
I believe you could use layouts and get away with something like this...
#application_controller.rb class ApplicationController < ActionController::Base layout :user_theme def user_theme current_user.theme end end
Then each layout you could adjust which css files to use.
Depending on your needs and how you have your site setup, I believe you could also just load a themed css file from the
<head>... with a
<%= stylesheet_link_tag current_user.theme %>
This should get your thinker tinkering - I'm sure there's a better way and I'm not sure what effect the multi-tenancy could have on any of these ideas...!
Thanks @jacob, thanks so much for your explanation, i've been thinking around that also, i found this gem
Do you think this can serve the purpose?. i'm looking at get over 20 templates from themeforest, so, when user want to register on my website, they can select which template they want on there home page. someone like wordpress.
i'm new to ruby on rail, i believe your years of experience can help me achieve this. thanks
I'd suggest making a branch of your project and just test it out. But from the looks of it, it seems like that gem would help you with the organization of your assets but it doesn't seem like there's any real magic going on there that you couldn't just replicate yourself and would save yourself the overhead of the gem dependency.
Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.