Module: Voltron::Upload::ControllerMethods
- Defined in:
- lib/voltron/upload.rb
Instance Method Summary collapse
Instance Method Details
#upload ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/voltron/upload.rb', line 30 def upload begin render json: uploader.process!(upload_params), status: :created rescue Voltron::Upload::Error => e render json: e.response, status: e.status end end |
#upload_params ⇒ Object
42 43 44 |
# File 'lib/voltron/upload.rb', line 42 def upload_params request.parameters[uploader.resource_name].slice(*uploader.permitted_params) end |
#uploader ⇒ Object
38 39 40 |
# File 'lib/voltron/upload.rb', line 38 def uploader self.class.instance_variable_get('@uploader') end |