Class: MorriganEditorRails::EditorImagesController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/morrigan_editor_rails/editor_images_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



3
4
5
6
7
8
9
10
# File 'app/controllers/morrigan_editor_rails/editor_images_controller.rb', line 3

def create
  if params["upload_img"]
    img_url = EditorImage.create(:image => params["upload_img"]).image.url
  else
    img_url = EditorImage.create(:remote_image_url => params["upload_url"]).image.url
  end
  render :text => {:data => img_url}.to_json
end