Changing stylesheet by using a selection list

Hey I can’t figure out how to change the stylesheet using a selection
list. In my application I want to have an option for the user to change
the look of the site by selecting a different layout from a list. All
it would say is something like Layout 1, Layout 2, etc. and then it
would change to the other layout. It isn’t necessary to do it via Ajax
or javascript or whatever would be used there, but if you know how to do
that, it would be even better. Thanks.

Tom D. wrote:

Hey I can’t figure out how to change the stylesheet using a selection
list. In my application I want to have an option for the user to change
the look of the site by selecting a different layout from a list. All
it would say is something like Layout 1, Layout 2, etc. and then it
would change to the other layout. It isn’t necessary to do it via Ajax
or javascript or whatever would be used there, but if you know how to do
that, it would be even better. Thanks.

  1. Post on select changed
  2. Save the selected value to session (select value is css file name)
  3. stylesheet_link_tag use the session value.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs