There, was that subject sufficiently obtuse to grab your attention?
I would like to have several different stylesheets for my application
that may be selected dynamically as the user navigates through my
site. I have seen this done in PHP by passing parameters to each page
visited selecting (in that particular example) a stylesheet with a
larger or smaller font size, or high contrast vs normal contrast
viewing. In the PHP example, the author appended
?fontsize=larger&contrast=high parameter to each link he generated.
Then, on each page, he looked at those parameters and selected the
What is the most elegant way to do a similar thing in RoR? Obviously,
the “on each page” part goes into the application layout.
I could follow his lead and simply add the parameters to every link I
generate in my views, but I wonder if there is a way to set a
parameter globally that would automatically get tacked onto any URL’s
generated by link_to and friends.
Alternatively, I could store the data used to select the stylesheet in
Alternatively, I could ask the community what other folks have done
and learn from them.