Class: WebrtcRails::RoomsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/webrtc_rails/rooms_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
# File 'app/controllers/webrtc_rails/rooms_controller.rb', line 10

def create
  @room = Room.new(room_params)

  if @room.valid?
    redirect_to room_path(@room)
  else
    render :new
  end
end

#newObject



6
7
8
# File 'app/controllers/webrtc_rails/rooms_controller.rb', line 6

def new
  @room = Room.new
end

#showObject



20
21
22
# File 'app/controllers/webrtc_rails/rooms_controller.rb', line 20

def show
  @room = Room.new(name: params[:id])
end