Class: PlaybooksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PlaybooksController
- Defined in:
- app/controllers/playbooks_controller.rb
Overview
Restful controller for Playbooks
Instance Method Summary collapse
-
#create ⇒ Object
POST /playbooks POST /playbooks.json.
-
#destroy ⇒ Object
DELETE /playbooks/1 DELETE /playbooks/1.json.
-
#edit ⇒ Object
GET /playbooks/1/edit.
-
#index ⇒ Object
GET /playbooks GET /playbooks.json.
-
#new ⇒ Object
GET /playbooks/new.
-
#show ⇒ Object
GET /playbooks/1 GET /playbooks/1.json.
-
#update ⇒ Object
PATCH/PUT /playbooks/1 PATCH/PUT /playbooks/1.json.
Methods inherited from ApplicationController
#check_for_mobile, #mobile_device?
Instance Method Details
#create ⇒ Object
POST /playbooks POST /playbooks.json
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/playbooks_controller.rb', line 28 def create @playbook = Playbook.new(playbook_params) @playbook respond_to do |format| if @playbook.save format.html { redirect_to @playbook, notice: t('.success') } format.json { render :show, status: :created, location: @playbook } else format.html { render :new } format.json { render json: @playbook.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /playbooks/1 DELETE /playbooks/1.json
58 59 60 61 62 63 64 |
# File 'app/controllers/playbooks_controller.rb', line 58 def destroy @playbook.destroy respond_to do |format| format.html { redirect_to playbooks_url, notice: t('.success') } format.json { head :no_content } end end |
#edit ⇒ Object
GET /playbooks/1/edit
24 |
# File 'app/controllers/playbooks_controller.rb', line 24 def edit() end |
#index ⇒ Object
GET /playbooks GET /playbooks.json
9 10 11 |
# File 'app/controllers/playbooks_controller.rb', line 9 def index @playbooks = policy_scope(Playbook) end |
#new ⇒ Object
GET /playbooks/new
18 19 20 21 |
# File 'app/controllers/playbooks_controller.rb', line 18 def new @playbook = Playbook.new @playbook end |
#show ⇒ Object
GET /playbooks/1 GET /playbooks/1.json
15 |
# File 'app/controllers/playbooks_controller.rb', line 15 def show() end |
#update ⇒ Object
PATCH/PUT /playbooks/1 PATCH/PUT /playbooks/1.json
44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/playbooks_controller.rb', line 44 def update respond_to do |format| if @playbook.update(playbook_params) format.html { redirect_to @playbook, notice: t('.success') } format.json { render :show, status: :ok, location: @playbook } else format.html { render :edit } format.json { render json: @playbook.errors, status: :unprocessable_entity } end end end |