Class: Phcscriptcdnpro::Script::AuthorsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Phcscriptcdnpro::Script::AuthorsController
- Defined in:
- app/controllers/phcscriptcdnpro/script/authors_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
CREATE - Script Author.
-
#destroy ⇒ Object
DELETE - Script Author.
-
#edit ⇒ Object
EDIT - Script Author.
-
#index ⇒ Object
INDEX - Script Author.
-
#new ⇒ Object
NEW - Script Author.
-
#show ⇒ Object
DETAILS - Script Author.
-
#update ⇒ Object
PATCH/PUT - Script Author.
Methods inherited from ApplicationController
#authrocket_membership_info, #current_user, #new_login_url, #require_user, #user_for_paper_trail
Instance Method Details
#create ⇒ Object
CREATE - Script Author
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 33 def create @script_author = Script::Author.new() @script_author.user_id = current_user.id @script_author.user_name = current_user.username @script_author.membership_id = authrocket_membership_info.id @script_author.oganization_id = authrocket_membership_info.org_id if @script_author.save redirect_to , notice: 'Author was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE - Script Author
60 61 62 63 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 60 def destroy @script_author.destroy redirect_to , notice: 'Author was successfully destroyed.' end |
#edit ⇒ Object
EDIT - Script Author
29 30 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 29 def edit end |
#index ⇒ Object
INDEX - Script Author
13 14 15 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 13 def index @script_authors = Script::Author.where(oganization_id: authrocket_membership_info.org_id) end |
#new ⇒ Object
NEW - Script Author
24 25 26 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 24 def new @script_author = Script::Author.new end |
#show ⇒ Object
DETAILS - Script Author
18 19 20 21 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 18 def show @script_authors = Script::Author.friendly.find(params[:id]) @versions = PaperTrail::Version.where(item_id: params[:id], item_type: 'Phcmemberspro::Directory::Category') end |
#update ⇒ Object
PATCH/PUT - Script Author
47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 47 def update @script_author.user_id = current_user.id @script_author.user_name = current_user.username @script_author.membership_id = authrocket_membership_info.id @script_author.oganization_id = authrocket_membership_info.org_id if @script_author.update() redirect_to , notice: 'Author was successfully updated.' else render :edit end end |