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
#current_user, #get_member_profile_info, #membership_info, #new_login_url, #phcpress_recent_posts, #require_user
Instance Method Details
#create ⇒ Object
POST - Script Licences
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 29 def create @script_licence = Script::Licence.new(script_licence_params) @script_licence.user_id = current_user.id @script_licence.user_name = current_user.username @script_licence.membership_id = membership_info.id @script_licence.oganization_id = membership_info.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
56 57 58 59 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 56 def destroy @script_licence.destroy redirect_to script_licences_url, notice: 'Licence was successfully destroyed.' end |
#edit ⇒ Object
EDIT - Script Licences
25 26 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 25 def edit end |
#index ⇒ Object
INDEX - Script Licences
11 12 13 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 11 def index @script_licences = Script::Licence.all end |
#new ⇒ Object
NEW - Script Licences
20 21 22 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 20 def new @script_licence = Script::Licence.new end |
#show ⇒ Object
DETAILS - Script Licences
16 17 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 16 def show end |
#update ⇒ Object
PATCH/PUT - Script Licences
43 44 45 46 47 48 49 50 51 52 53 |
# File 'app/controllers/phcscriptcdnpro/script/licences_controller.rb', line 43 def update @script_licence.user_id = current_user.id @script_licence.user_name = current_user.username @script_licence.membership_id = membership_info.id @script_licence.oganization_id = membership_info.org_id if @script_licence.update(script_licence_params) redirect_to script_licences_url, notice: 'Licence was successfully updated.' else render :edit end end |