Git Product home page Git Product logo

contenteditable's Introduction

Contenteditable

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

demo: http://www.youtube.com/watch?v=WRt5WoQQajU&feature=youtu.be

Installation

Install gem

gem "contenteditable", :github => 'micmmakarov/contenteditable'

bundle install

Run install script

rails generate contenteditable:install

Generate table

rake db:migrate

Use

Use simple tags in views

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"

Configure access

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.

Rails 3.2.x fix

Add this to your Gemfile:

gem 'i18n-active_record',
  :git => 'git://github.com/svenfuchs/i18n-active_record.git',
  :branch => 'rails-3.2',
  :require => 'i18n/active_record'

Enjoy

First version must be buggy. Fix it if you find!

Enjoy!

Under MIT license

contenteditable's People

Contributors

micmmakarov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

contenteditable's Issues

NoMethodError after rake db:migrate

Hi,

I hit a wall after doing a rake db:migrate. I am getting a NoMethodError. Do you have an idea how I can solve this? (sorry I am a newbie)

Thanks!

E:\sl-marketing>rake db:migrate
DL is deprecated, please use Fiddle
rake aborted!
NoMethodError: undefined method set_table_name' for #<Class:0x5054760> E:/sl-marketing/config/initializers/locale.rb:1:in<top (required)>'
E:/sl-marketing/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.