Class: Api::V2::ForeignInputSetsController
- Inherits:
-
BaseController
- Object
- BaseController
- Api::V2::ForeignInputSetsController
- Includes:
- Api::Version2, Foreman::Controller::Parameters::ForeignInputSet, Foreman::Renderer
- Defined in:
- app/controllers/api/v2/foreign_input_sets_controller.rb
Instance Method Summary collapse
- #action_permission ⇒ Object
- #controller_permission ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #resource_name(nested_resource = nil) ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#action_permission ⇒ Object
65 66 67 68 69 70 71 72 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 65 def case params[:action] when :create, :edit, :destroy 'edit' else super end end |
#controller_permission ⇒ Object
61 62 63 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 61 def 'templates' end |
#create ⇒ Object
37 38 39 40 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 37 def create @foreign_input_set = resource_class.new(foreign_input_set_params.merge(:template_id => @nested_obj.id)) process_response @foreign_input_set.save end |
#destroy ⇒ Object
45 46 47 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 45 def destroy process_response @foreign_input_set.destroy end |
#index ⇒ Object
14 15 16 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 14 def index @foreign_input_sets = nested_obj.foreign_input_sets.search_for(*).paginate() end |
#resource_name(nested_resource = nil) ⇒ Object
57 58 59 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 57 def resource_name(nested_resource = nil) nested_resource || 'foreign_input_set' end |
#show ⇒ Object
21 22 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 21 def show end |
#update ⇒ Object
53 54 55 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 53 def update process_response @foreign_input_set.update(foreign_input_set_params) end |