Interesting design. My two cents are that you should avoid putting
the html and css in the database, as you''ll likely see performance
problems as your site grows. Instead, I would recommend you store the
custom html and css in discrete files on the filesystem. I don''t know
of any plugins/gems out there to handle writing to disk (maybe
Paperclip? http://github.com/thoughtbot/paperclip), but you may want
to take inspiration from Thoughtbot''s High Voltage plugin (http://
github.com/thoughtbot/high_voltage) to load the needed design file
once it''s created.
Hope this helps some. Best of luck!
Jeff
On Nov 3, 2:15 pm, Erik Peterson
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I''m working on an app that allows users to customize an HTML
design
> template to suit their needs. The user will be able to customize css
> through a graphical interface and then output an HTML for their usage.
>
> The basic idea is that each ''design'' would have a variety
of canned
> ''styles'' or the user can create a
''custom'' one. My current thinking on
> the DB was that I would have a something like the following:
>
> Designs - has many styles (columns: name, HTML, ?)
> Styles - belongs to design (columns: name, HTML, ?)
> Users (name, password, ?)
>
> My questions are as follows.
>
> First what columns do I need to add to my DB?
>
> I will be displaying the current design (the one that the user is
> customizing) on the lower portion of the page as the user makes changes.
> They will be able click a button to update the preview as they move
> through the customization. Where should I store these HTML pages that
> user can customize? Should I load all the HTML into a DB and then when a
> user wants to customize one, create a copy associated with that user and
> allow them to customize that version?
>
> If the user is basically editing css through a GUI, should I be storing
> each value in a DB (i,e, heading font-size= 2em, heading color=red, etc)
> and then use erb in my html design to reflect whatever the user has
> selected? So when they click the preview I would just pull the various
> css values from the DB and dump them into that html file when it''s
> displayed for them.
>
> btw, I''m thinking of dumping the css inline so the user will have
> everything in one final HTML file.
>
> Any thoughts on how to proceed would be great. If you haven''t
figured it
> out by now, I''m noob at rails...
> --
> Posted viahttp://www.ruby-forum.com/.