Class: ActionBlocks::AttachmentsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- ActionBlocks::AttachmentsController
- Defined in:
- app/controllers/action_blocks/attachments_controller.rb
Instance Method Summary collapse
Instance Method Details
#download ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/action_blocks/attachments_controller.rb', line 5 def download model = ActionBlocks.find(params[:model_key]) if model == nil raise RecordNotFound end id = params[:id] field = params[:field] record = model.active_model.find(id) = record.send(field) begin send_data .download rescue Module::DelegationError raise ActiveRecord::RecordNotFound end end |