This project is not maintained anymore
If you like it or continue to use it fork it please.
A rails_admin plugin to edit site contents from the frontend.
If the user is logged in rails_admin a fixed bar on bottom is shown. It allows to edit (or delete) the current record (if in a show page) or to create a new one.
Demo: heroku app
-
Add to Gemfile:
gem 'rails_admin_live_edit'
-
Add to application layout (in body) (erb example):
<%= render 'live_edit/ra_live_editor' %>
-
[Optional] Instead of letting the model name being guest from the controller name that rendered the view you can render the live_editor partial passing the target_model and/or the target_model_id like this:
<%= render partial: 'live_edit/ra_live_editor', locals: { target_model: 'post', target_model_id: 42 } %>
-
Edit or create app/assets/javascripts/rails_admin/custom/ui.js and add:
//= require rails_admin/plugins/live_edit/ui.js
- This plugin use
current_user
method to check if the user is logged in; to bypass this check it is possible to define acurrent_user
helper method.
- Mattia Roccoberton - creator, maintainer