Contenteditable helps to integrate an easy CRM system to provide a client an opportunity editing content on a website.
- This is a lite version, it's easy connectable to an app
- Generates a table to keep the data
- Uses contenteditable HTML5 tag
gem "contenteditable", :github => 'micmmakarov/contenteditable_lite'
bundle install
rails generate contenteditable:install
rake db:migrate
after BODY tag add:
<%= save_button %> to use build-in save button or alternatively use "contenteditable_save_button" class if you want to make a button on your own
In the view, where it's supposed to be contenteditable
<%= ceditable("title", "h1") %>
or
<%= ceditable("title", "h1", {:class => 'green'}) %>
where "title" should be a unique key, for example "front page tagline" or "about description"
application controller:
contenteditable_filter :autintificate_admin!
this is an analog of "before_filter" if you use devise. Editable interface will be only provided to admins in this case.
First version must be buggy. Fix it if you find!
Enjoy!
Under MIT license