Class: Phcscriptcdnpro::Script::LicencesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Phcscriptcdnpro::Script::LicencesController
- Defined in:
- app/controllers/phcscriptcdnpro/script/licences_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST - Script Licences.
-
#destroy ⇒ Object
DELETE - Script Licences.
-
#edit ⇒ Object
EDIT - Script Licences.
-
#index ⇒ Object
INDEX - Script Licences.
-
#new ⇒ Object
NEW - Script Licences.
-
#show ⇒ Object
DETAILS - Script Licences.
-
#update ⇒ Object
PATCH/PUT - Script Licences.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
POST - Script Licences
34 35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 34 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, notice: 'Licence was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE - Script Licences
57 58 59 60 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 57 def destroy @script_licence.destroy redirect_to script_licences_url, notice: 'Licence was successfully destroyed.' end |
#edit ⇒ Object
EDIT - Script Licences
30 31 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 30 def edit end |
#index ⇒ Object
INDEX - Script Licences
12 13 14 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 12 def index @script_licences = Script::Licence.where(org_id: current_user.org_id) end |
#new ⇒ Object
NEW - Script Licences
23 24 25 26 27 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 23 def new @script_licence = Script::Licence.new @script_licence.user_id = current_user.id @script_licence.org_id = current_user.org_id end |
#show ⇒ Object
DETAILS - Script Licences
17 18 19 20 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 17 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
PATCH/PUT - Script Licences
46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 46 def update @script_licence.user_id = current_user.id @script_licence.org_id = current_user.org_id if @script_licence.update(script_licence_params) redirect_to script_licences_url, notice: 'Licence was successfully updated.' else render :edit end end |