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
Instance Method Details
#create ⇒ Object
CREATE - Script Author
34 35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 34 def create @script_author = Script::Author.new() @script_author.user_id = current_user.id @script_author.org_id = current_user.org_id if @script_author.save redirect_to , notice: 'Author was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE - Script Author
57 58 59 60 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 57 def destroy @script_author.destroy redirect_to , notice: 'Author was successfully destroyed.' end |
#edit ⇒ Object
EDIT - Script Author
30 31 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 30 def edit end |
#index ⇒ Object
INDEX - Script Author
12 13 14 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 12 def index @script_authors = Script::Author.where(org_id: current_user.org_id) end |
#new ⇒ Object
NEW - Script Author
23 24 25 26 27 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 23 def new @script_author = Script::Author.new @script_author.user_id = current_user.id @script_author.org_id = current_user.org_id end |
#show ⇒ Object
DETAILS - Script Author
17 18 19 20 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 17 def show @script_authors = Script::Author.friendly.find(params[:id]) @versions = Phcscriptcdnpro::AuthorVersion.where(item_id: params[:id], item_type: 'Phcscriptcdnpro::Script::Author') end |
#update ⇒ Object
PATCH/PUT - Script Author
46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/phcscriptcdnpro/script/authors_controller.rb', line 46 def update @script_author.user_id = current_user.id @script_author.org_id = current_user.org_id if @script_author.update() redirect_to , notice: 'Author was successfully updated.' else render :edit end end |