Class: ChatsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/appchat/templates/chats_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
# File 'lib/generators/appchat/templates/chats_controller.rb', line 8

def create
  @chat = Chat.create
  redirect_to @chat
end

#indexObject



5
6
7
# File 'lib/generators/appchat/templates/chats_controller.rb', line 5

def index
  @chats = Chat.all.reverse
end

#showObject



2
3
4
# File 'lib/generators/appchat/templates/chats_controller.rb', line 2

def show
  @chat = Chat.find(params[:id])
end