Class: ThinkFeelDoDashboard::ArmsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ThinkFeelDoDashboard::ArmsController
- Defined in:
- app/controllers/think_feel_do_dashboard/arms_controller.rb
Overview
Allows for the creation, updating, and deletion of arms
Instance Method Summary collapse
-
#create ⇒ Object
POST /think_feel_do_dashboard/arms.
-
#destroy ⇒ Object
DELETE /think_feel_do_dashboard/arms/1.
-
#edit ⇒ Object
GET /think_feel_do_dashboard/arms/1/edit.
-
#index ⇒ Object
GET /think_feel_do_dashboard/arms.
-
#new ⇒ Object
GET /think_feel_do_dashboard/arms/new.
-
#show ⇒ Object
GET /think_feel_do_dashboard/arms/1.
-
#update ⇒ Object
PATCH/PUT /think_feel_do_dashboard/arms/1.
Instance Method Details
#create ⇒ Object
POST /think_feel_do_dashboard/arms
15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/think_feel_do_dashboard/arms_controller.rb', line 15 def create :create, Arm @arm = Arm.new(arm_params) if @arm.save redirect_to @arm, notice: "Arm was successfully created." else render :new end end |
#destroy ⇒ Object
DELETE /think_feel_do_dashboard/arms/1
59 60 61 62 63 64 65 |
# File 'app/controllers/think_feel_do_dashboard/arms_controller.rb', line 59 def destroy @arm = Arm.find(params[:id]) :destroy, @arm redirect_to arm_path(@arm), notice: "You do not have privileges to delete an arm. "\ "Please contact the site administrator to remove this arm." end |
#edit ⇒ Object
GET /think_feel_do_dashboard/arms/1/edit
40 41 42 43 |
# File 'app/controllers/think_feel_do_dashboard/arms_controller.rb', line 40 def edit @arm = Arm.find(params[:id]) :edit, @arm end |
#index ⇒ Object
GET /think_feel_do_dashboard/arms
9 10 11 12 |
# File 'app/controllers/think_feel_do_dashboard/arms_controller.rb', line 9 def index :index, Arm @arms = Arm.includes(:groups) end |
#new ⇒ Object
GET /think_feel_do_dashboard/arms/new
27 28 29 30 |
# File 'app/controllers/think_feel_do_dashboard/arms_controller.rb', line 27 def new :new, Arm @arm = Arm.new end |
#show ⇒ Object
GET /think_feel_do_dashboard/arms/1
33 34 35 36 37 |
# File 'app/controllers/think_feel_do_dashboard/arms_controller.rb', line 33 def show @arm = Arm.find(params[:id]) :show, @arm @lesson = @arm.bit_core_tools.find_by_type("Tools::Learn") end |
#update ⇒ Object
PATCH/PUT /think_feel_do_dashboard/arms/1
46 47 48 49 50 51 52 53 54 55 56 |
# File 'app/controllers/think_feel_do_dashboard/arms_controller.rb', line 46 def update @arm = Arm.find(params[:id]) :update, @arm if @arm.update(arm_params) redirect_to arm_path(@arm), notice: "Arm was successfully updated.", only: true else render :edit end end |