Class: Exo::GridfsController
- Inherits:
-
ExoController
- Object
- ActionController::Base
- ExoController
- Exo::GridfsController
- Defined in:
- app/controllers/exo/gridfs_controller.rb
Instance Method Summary collapse
Instance Method Details
#asset ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/controllers/exo/gridfs_controller.rb', line 9 def asset asset = exo_site.slug_scope(Exo::Asset).find_by _id: params[:id] if asset respond_with_asset asset else render text: "Asset not found", status: 500 end end |
#item_asset ⇒ Object
3 4 5 6 7 |
# File 'app/controllers/exo/gridfs_controller.rb', line 3 def item_asset item = exo_site.resource(params[:resource_slug_id]).items.find_by slug_id: params[:item_slug_id] asset = item.send params[:field_slug_id].to_sym respond_with_asset asset end |