I this is a really general question, but what would be the best way to go about allowing users to customize the color of their logged in profile? Should I put css the inline? Nnd can I store the color values in something like a the session so they do not have to be looked up everytime?
Share
If you will be selecting creating the themes and allowing the user to select them, the best way would be to create a common stylesheet with properties such as position, float etc. but none of the color related properties. Then create a second one with the color related properties — you can create as many of these as necessary. You can them import them using:
In a cookie you could just store one value, eg ‘skin=skin-blue’ and just import the correct stylesheet in the RoR layout.
Another option would be to use the alternate stylesheets technique described at http://www.alistapart.com/articles/alternate/ – this is completely client side so you’ll have less to do on the RoR side while still giving users the flexability you want.