Forum: Ruby on Rails User editable webpages

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Shandy N. (Guest)
on 2008-10-24 21:59
I have to build this webpage where the user can select the color, add a
picture, overall make the layout the way that they want. Can anyone
point me to a tutorial and give me some suggestions on how to get
started on this, I am unsure how to proceed. Thanks,

DyingToLearn (Guest)
on 2008-10-25 13:49
(Received via mailing list)
I don't know of a tutorial that can do this, but here is how I would
approach the problem:

For changing colours, you need to change the CSS. You should probably
break your CSS into (at least) two CSS files. One containing the
normal CSS, and one containing what the user is permitted to change.

Then you need to generate CSS files on the fly based on the user's
input. You could probably have a template file, and then do a gsub to
fill in all the colours (or other options that can be changed). Then
save this generated CSS file in public/stylesheets/
custom_for_user_id.css (or whatever make sense).

Then in you view layout you can do

If you really want to let users make the layout any "way that they
want", then you should probably just let them upload their own CSS. I
think typo has some code that allows the user to edit the CSS directly
from the web UI. You might want to look into that if your users need
that much freedom.

This topic is locked and can not be replied to.