Class: ThinkFeelDoDashboard::ParticipantsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/think_feel_do_dashboard/participants_controller.rb

Overview

Allows for the creation, updating, and deletion of participants

Instance Method Summary collapse

Instance Method Details

#createObject

POST /think_feel_do_dashboard/participants



14
15
16
17
18
19
20
21
# File 'app/controllers/think_feel_do_dashboard/participants_controller.rb', line 14

def create
  if @participant.save
    redirect_to @participant,
                notice: "Participant was successfully created."
  else
    render :new
  end
end

#destroyObject

DELETE /think_feel_do_dashboard/participants/1



47
48
49
50
51
# File 'app/controllers/think_feel_do_dashboard/participants_controller.rb', line 47

def destroy
  @participant.destroy
  redirect_to participants_url,
              notice: "Participant was successfully destroyed."
end

#editObject

GET /think_feel_do_dashboard/participants/1/edit



32
33
# File 'app/controllers/think_feel_do_dashboard/participants_controller.rb', line 32

def edit
end

#indexObject

GET /think_feel_do_dashboard/participants



10
11
# File 'app/controllers/think_feel_do_dashboard/participants_controller.rb', line 10

def index
end

#newObject

GET /think_feel_do_dashboard/participants/new



24
25
# File 'app/controllers/think_feel_do_dashboard/participants_controller.rb', line 24

def new
end

#showObject

GET /think_feel_do_dashboard/participants/1



28
29
# File 'app/controllers/think_feel_do_dashboard/participants_controller.rb', line 28

def show
end

#updateObject

PATCH/PUT /think_feel_do_dashboard/participants/1



36
37
38
39
40
41
42
43
44
# File 'app/controllers/think_feel_do_dashboard/participants_controller.rb', line 36

def update
  if @participant.update(participant_params)
    redirect_to participant_path(@participant),
                notice: "Participant was successfully updated.",
                only: true
  else
    render :edit
  end
end