twitter bootstrap - How to Dynamically change Themes of website using ruby on rails -


in website want dynamically assign themes in application.erb.html using dropdown on selected change of ruby on rails application..

my application.html.erb file follows

<%= stylesheet_link_tag "#{current_theme}" %>  <%= select_tag(:current_theme, options_for_select([['cerulean'], ['superhero'], 'amelia'], ['cosmo']])) %> 

i want change current theme dynamically requirement want assign theme on dropdown select change

please me

first of need create separate directories each theme can managed in convenient way. next select default theme , store in browser session. when user changes theme need trigger change event on dropdown, update session , select theme. in layouts/application.html.haml this.

<%= stylesheet_link_tag "#{session[:theme]}" %>  <%= select_tag(:current_theme, options_for_select([['cerulean'], ['superhero'], 'amelia'], ['cosmo']])) %> 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -