Class: TalkingStick::ParticipantsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- TalkingStick::ParticipantsController
- Defined in:
- app/controllers/talking_stick/participants_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /participants.
-
#destroy ⇒ Object
DELETE /participants/1.
-
#edit ⇒ Object
GET /participants/1/edit.
-
#index ⇒ Object
GET /participants.
-
#new ⇒ Object
GET /participants/new.
-
#show ⇒ Object
GET /participants/1.
-
#update ⇒ Object
PATCH/PUT /participants/1.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
POST /participants
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/talking_stick/participants_controller.rb', line 27 def create params = participant_params.merge ip: request.remote_ip @participant = Participant.new(params) @participant.room = @room respond_to do |format| if @participant.save format.json { render json: @participant } else render :new end end end |
#destroy ⇒ Object
DELETE /participants/1
51 52 53 54 |
# File 'app/controllers/talking_stick/participants_controller.rb', line 51 def destroy @participant.destroy redirect_to talking_stick.room_path(@room), notice: 'Participant was successfully destroyed.' end |
#edit ⇒ Object
GET /participants/1/edit
23 24 |
# File 'app/controllers/talking_stick/participants_controller.rb', line 23 def edit end |
#index ⇒ Object
GET /participants
9 10 11 |
# File 'app/controllers/talking_stick/participants_controller.rb', line 9 def index @participants = Participant.all end |
#new ⇒ Object
GET /participants/new
18 19 20 |
# File 'app/controllers/talking_stick/participants_controller.rb', line 18 def new @participant = Participant.new end |
#show ⇒ Object
GET /participants/1
14 15 |
# File 'app/controllers/talking_stick/participants_controller.rb', line 14 def show end |
#update ⇒ Object
PATCH/PUT /participants/1
42 43 44 45 46 47 48 |
# File 'app/controllers/talking_stick/participants_controller.rb', line 42 def update if @participant.update(participant_params) redirect_to talking_stick.room_path(@room), notice: 'Participant was successfully updated.' else render :edit end end |