Class: Api::V2::ForeignInputSetsController
- Inherits:
-
BaseController
- Object
- BaseController
- Api::V2::ForeignInputSetsController
- Includes:
- Api::Version2, 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
64 65 66 67 68 69 70 71 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 64 def case params[:action] when :create, :edit, :destroy 'edit' else super end end |
#controller_permission ⇒ Object
60 61 62 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 60 def 'templates' end |
#create ⇒ Object
36 37 38 39 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 36 def create @foreign_input_set = resource_class.new(params[:foreign_input_set].merge(:template_id => @nested_obj.id)) process_response @foreign_input_set.save end |
#destroy ⇒ Object
44 45 46 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 44 def destroy process_response @foreign_input_set.destroy end |
#index ⇒ Object
13 14 15 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 13 def index @foreign_input_sets = nested_obj.foreign_input_sets.search_for(*).paginate() end |
#resource_name(nested_resource = nil) ⇒ Object
56 57 58 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 56 def resource_name(nested_resource = nil) nested_resource || 'foreign_input_set' end |
#show ⇒ Object
20 21 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 20 def show end |
#update ⇒ Object
52 53 54 |
# File 'app/controllers/api/v2/foreign_input_sets_controller.rb', line 52 def update process_response @foreign_input_set.update_attributes(params[:foreign_input_set]) end |