Rails: make views editable by end users?

Is there anyway I can make the content in my Rails views editable by end users? So that they can make simple text changes on the pages that I allow them, without me having to edit the HAML files myself?

Thoughts?

CLARIFICATION:

I am aware of CMS systems and I don't think this is what I want. I want to maintain programmatic control over my views, but there are sections that I want the user to be able to edit directly (for example, I still need to populate the page with products, shopping cart, database blog posts, etc., but I want so that the user can edit the About Us or Contact Us page, or edit the title text on the product category page, or update the translation of any of those pages).

I know I can put these sections into the database, but since this is just most of the straight text, there was something I didn't like very much about this approach (I couldn't figure out how I would organize it cleanly and efficiently). is this stuff from text files? Formatted in Textile / Markdown? Is this an acceptable approach? Or perhaps a database based approach?

+2


source to share


3 answers


You are describing a CMS. Check out BrowserCMS and RadiantCMS .



In short, you need to extract the editable parts of the page and store them somewhere, usually in a DB. You can edit these parts of the page through your typical web forms. Extra glasses for ajax / in-place editing, but other than that there isn't much magic. This railscast can also be useful if you don't need a full blown CMS.

+2


source


Take a look at Liquid . It's a pretty powerful templating language pulled from Shopify.



+2


source


One option is to use one of the many CMS ( BrowserCMS rock) or use one of the I18n tools that give you an editor for your i18n files and make sure all text is pulled from the language file.

0


source







All Articles