Class: ActiveadminSettings::PicturesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ActiveadminSettings::PicturesController
- Defined in:
- app/controllers/activeadmin_settings/pictures_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/activeadmin_settings/pictures_controller.rb', line 9 def create @picture = ActiveadminSettings::Picture.new @picture.data = params[:file] if @picture.save render :json => { :filelink => @picture.url } else render :nothing => true end end |
#index ⇒ Object
4 5 6 7 |
# File 'app/controllers/activeadmin_settings/pictures_controller.rb', line 4 def index @pictures = ActiveadminSettings::Picture.all render :json => @pictures end |