Class: ScapContentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ScapContentsController
- Includes:
- Foreman::Controller::AutoCompleteSearch, Foreman::Controller::Parameters::ScapContent
- Defined in:
- app/controllers/scap_contents_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #model_of_controller ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/controllers/scap_contents_controller.rb', line 26 def create @scap_content = ForemanOpenscap::ScapContent.new(scap_content_params) if @scap_content.save process_success else process_error end end |
#destroy ⇒ Object
43 44 45 46 47 48 49 |
# File 'app/controllers/scap_contents_controller.rb', line 43 def destroy if @scap_content.destroy process_success else process_error :object => @scap_content end end |
#index ⇒ Object
12 13 14 |
# File 'app/controllers/scap_contents_controller.rb', line 12 def index @contents = resource_base_search_and_page.search_for(params[:search]) end |
#model_of_controller ⇒ Object
8 9 10 |
# File 'app/controllers/scap_contents_controller.rb', line 8 def model_of_controller ::ForemanOpenscap::ScapContent end |
#new ⇒ Object
22 23 24 |
# File 'app/controllers/scap_contents_controller.rb', line 22 def new @scap_content = ForemanOpenscap::ScapContent.new end |
#show ⇒ Object
16 17 18 19 20 |
# File 'app/controllers/scap_contents_controller.rb', line 16 def show send_data @scap_content.scap_file, :type => 'application/xml', :filename => @scap_content.original_filename end |
#update ⇒ Object
35 36 37 38 39 40 41 |
# File 'app/controllers/scap_contents_controller.rb', line 35 def update if @scap_content.update(scap_content_params) process_success else process_error end end |