Class: Assetable::ExternalServicesController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Assetable::ExternalServicesController
- Defined in:
- app/controllers/assetable/external_services_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Create a new external service asset.
-
#new ⇒ Object
New template.
-
#permitted_params ⇒ Object
Permitted params for the model.
Instance Method Details
#create ⇒ Object
Create a new external service asset
18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/assetable/external_services_controller.rb', line 18 def create @external_service = Assetabler::ExternalService.new(permitted_params) if @external_service.errors.empty? and @external_service.save @fieldname = params[:fieldname] @uploader_id = params[:uploader_id] render :create else render :error end end |
#new ⇒ Object
New template
11 12 13 14 15 |
# File 'app/controllers/assetable/external_services_controller.rb', line 11 def new @external_service = Assetabler::ExternalService.new @fieldname = params[:fieldname] @uploader_id = params[:uploader_id] end |
#permitted_params ⇒ Object
Permitted params for the model
31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/assetable/external_services_controller.rb', line 31 def permitted_params params.require(:external_service).permit( :name, :filename, :body, :content_type, :width, :height, :uploader_id ) end |