Class: Admin::EditorController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::EditorController
- Defined in:
- app/controllers/amalgam/admin/editor_controller.rb
Instance Method Summary collapse
- #update ⇒ Object
-
#upload_image ⇒ Object
POST /images.json.
Instance Method Details
#update ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'app/controllers/amalgam/admin/editor_controller.rb', line 4 def update ContentPersistence.save(params[:content]) if params[:content] respond_to do |format| format.json {render :text => '{}'} format.js { render :text => 'Mercury.trigger("saved")' } end end |
#upload_image ⇒ Object
POST /images.json
15 16 17 18 19 20 21 22 |
# File 'app/controllers/amalgam/admin/editor_controller.rb', line 15 def upload_image @image = Attachment.new(params[:image]) respond_to do |format| if @image.save format.json { render :json => @image } end end end |