Skip to content

Commit 1d1d503

Browse files
committed
Small bug where the sender wasn't getting sent.
1 parent 1561cd7 commit 1d1d503

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

controllers/messages.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#people can get a form to send messages here
22
get "/messages/new/to/:username" do
3+
#gotta be logged in!
4+
require_login!
5+
36
#we've got to save the username to put it in the view
47
@username = params[:username]
58

@@ -9,6 +12,11 @@
912

1013
#this is where the form POSTs to
1114
post "/messages" do
15+
#gotta be logged in!
16+
require_login!
17+
18+
params[:message][:sender] = current_user.username
19+
1220
#make a new message with our params
1321
message = Message.create(params[:message])
1422

0 commit comments

Comments
 (0)