Quickedit is an embeddable micro-CMS for Rails, Sinatra and Rack which allows you to easily edit any content in-place. Perfect for adding temporary editing capabilities to any app.
Install the Quickedit gem:
# Rails 3 (Bundler): Add to Gemfile gem "quickedit" # Other frameworks: # Install the gem: `gem install quickedit` # Add to your app: require 'quickedit' # Add the middleare: use Quickedit # Include the helpers: include Quickedit::Helpers
Enable Quickedit for some users:
# Example for Rails 3 class ApplicationController before_filter do # Enable for all users in this case env['quickedit.enable'] = true end end
Change your view from:
<h2><%= @post.title %></h2>
<h2><%= quickedit(@post).title %></h2>
You're done! Visit the page in your browser.
Quickedit will automatically escape the value (unless it's already been marked HTML safe). If you want to output the raw HTML please use the #raw method:
<h2><%= quickedit(@post).title.raw %></h2>
Quickedit is based on rack-cms written by Brennan Dunn.
Once you've made your great commits: