Class: Phcscriptcdnpro::Script::LicencesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Phcscriptcdnpro::Script::LicencesController
- Includes:
- Phccorehelpers::PhcpluginsproHelper
- Defined in:
- app/controllers/phcscriptcdnpro/script/licences_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
CREATE.
-
#destroy ⇒ Object
DELETE.
-
#edit ⇒ Object
EDIT.
-
#index ⇒ Object
INDEX.
-
#new ⇒ Object
NEW.
-
#show ⇒ Object
SHOW.
-
#update ⇒ Object
UPDATE.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
CREATE
33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 33 def create @script_licence = Script::Licence.new(script_licence_params) @script_licence.user_id = current_user.id @script_licence.org_id = current_user.org_id if @script_licence.save redirect_to script_licences_url, :flash => { :success => 'Licence was successfully created.' } else render :new end end |
#destroy ⇒ Object
DELETE
54 55 56 57 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 54 def destroy @script_licence.destroy redirect_to script_licences_url, :flash => { :error => 'Licence was successfully destroyed.' } end |
#edit ⇒ Object
EDIT
29 30 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 29 def edit end |
#index ⇒ Object
INDEX
13 14 15 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 13 def index @script_licences = Script::Licence.where(org_id: current_user.org_id) end |
#new ⇒ Object
NEW
24 25 26 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 24 def new @script_licence = Script::Licence.new end |
#show ⇒ Object
SHOW
18 19 20 21 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 18 def show @script_licences = Script::Licence.friendly.find(params[:id]) @versions = Phcscriptcdnpro::LicenceVersions.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script::Licence') end |
#update ⇒ Object
UPDATE
45 46 47 48 49 50 51 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 45 def update if @script_licence.update(script_licence_params) redirect_to script_licences_url, :flash => { :success => 'Licence was successfully updated.' } else render :edit end end |