Class: Admin::EditorController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/amalgam/admin/editor_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



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_imageObject

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