Contenteditable helps to integrate easy CRM system to provide client an opportunity editing content on a website.
- This is 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 install:contenteditable:migrations
rake db:migrate
To the head of layouts/application view: <%= contenteditable_assets %> after tag: <%= save_button %>
In the view, where it's supposed to be contenteditable <%= ceditable("title", "h1") %>
or
<%= ceditable("title", "h1", {:class => 'green'}) %>
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