diff --git a/.idea/.generators b/.idea/.generators
new file mode 100644
index 0000000..aa3c1a6
--- /dev/null
+++ b/.idea/.generators
@@ -0,0 +1,8 @@
+
+
+
+
+
+
- 50: <%= message.content %> - 51:
- -app/views/chat/index.html.erb:48:in `block in _app_views_chat_index_html_erb___4287554693297546200_70226424158540' -app/views/chat/index.html.erb:30:in `_app_views_chat_index_html_erb___4287554693297546200_70226424158540' - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (39.8ms) - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (9.3ms) - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.5ms) - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (116.7ms) -Started GET "/chat" for 127.0.0.1 at 2016-11-27 16:57:05 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.3ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] - [1m[36mMessage Load (0.4ms)[0m [1m[34mSELECT DISTINCT "messages"."recieve_user" FROM "messages" WHERE "messages"."send_user" = ?[0m [["send_user", 5]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 8], ["LIMIT", 1]] - [1m[36mCACHE (0.0ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (1.1ms) - [1m[36mMessage Load (0.3ms)[0m [1m[34mSELECT "messages".* FROM "messages" WHERE "messages"."send_user" IN (5, 6) AND "messages"."recieve_user" IN (5, 6) ORDER BY "messages"."create_time" ASC[0m - Rendered chat/index.html.erb within layouts/application (8.6ms) - Rendered layouts/_title.html.erb (1.0ms) - Rendered layouts/_refer.html.erb (0.8ms) -Completed 200 OK in 2137ms (Views: 24.1ms | ActiveRecord: 1.3ms) - - -Started GET "/chat" for 127.0.0.1 at 2016-11-27 16:59:17 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.3ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] - [1m[36mMessage Load (0.3ms)[0m [1m[34mSELECT DISTINCT "messages"."recieve_user" FROM "messages" WHERE "messages"."send_user" = ?[0m [["send_user", 5]] - [1m[36mUser Load (0.2ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - [1m[36mUser Load (0.3ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 8], ["LIMIT", 1]] - [1m[36mCACHE (0.0ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.9ms) - [1m[36mMessage Load (0.3ms)[0m [1m[34mSELECT "messages".* FROM "messages" WHERE "messages"."send_user" IN (5, 6) AND "messages"."recieve_user" IN (5, 6) ORDER BY "messages"."create_time" ASC[0m - Rendered chat/index.html.erb within layouts/application (8.7ms) - Rendered layouts/_title.html.erb (1.0ms) - Rendered layouts/_refer.html.erb (0.7ms) -Completed 200 OK in 3262ms (Views: 24.9ms | ActiveRecord: 1.4ms) - - -Started GET "/chat" for 127.0.0.1 at 2016-11-27 16:59:50 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.2ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] - [1m[36mMessage Load (0.3ms)[0m [1m[34mSELECT DISTINCT "messages"."recieve_user" FROM "messages" WHERE "messages"."send_user" = ?[0m [["send_user", 5]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 8], ["LIMIT", 1]] - [1m[36mCACHE (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.7ms) - [1m[36mMessage Load (0.4ms)[0m [1m[34mSELECT "messages".* FROM "messages" WHERE "messages"."send_user" IN (5, 6) AND "messages"."recieve_user" IN (5, 6) ORDER BY "messages"."create_time" ASC[0m - Rendered chat/index.html.erb within layouts/application (8.6ms) - Rendered layouts/_title.html.erb (0.5ms) - Rendered layouts/_refer.html.erb (0.5ms) -Completed 200 OK in 2071ms (Views: 19.4ms | ActiveRecord: 1.2ms) - - -Started GET "/chat" for 127.0.0.1 at 2016-11-27 17:05:39 +0800 - [1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m -Processing by ChatController#index as HTML - [1m[36mUser Load (0.2ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] -Completed 500 Internal Server Error in 30ms (ActiveRecord: 0.7ms) - - - -NoMethodError (undefined method `empty?' for nil:NilClass): - -app/controllers/chat_controller.rb:7:in `index' - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (3.9ms) - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.9ms) - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms) - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (70.0ms) -Started GET "/chat" for 127.0.0.1 at 2016-11-27 17:06:09 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] -Completed 500 Internal Server Error in 15ms (ActiveRecord: 0.9ms) - - - -NoMethodError (undefined method `empty?' for nil:NilClass): - -app/controllers/chat_controller.rb:8:in `index' - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (2.8ms) - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.3ms) - Rendering /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.6ms) - Rendered /Users/zhangyu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (65.9ms) -Started GET "/chat" for 127.0.0.1 at 2016-11-27 17:06:31 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] - [1m[36mMessage Load (0.1ms)[0m [1m[34mSELECT DISTINCT "messages"."recieve_user" FROM "messages" WHERE "messages"."send_user" = ?[0m [["send_user", 5]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 8], ["LIMIT", 1]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.5ms) - [1m[36mMessage Load (0.2ms)[0m [1m[34mSELECT "messages".* FROM "messages" WHERE "messages"."send_user" IN (5, 6) AND "messages"."recieve_user" IN (5, 6) ORDER BY "messages"."create_time" ASC[0m - Rendered chat/index.html.erb within layouts/application (4.3ms) - Rendered layouts/_title.html.erb (0.3ms) - Rendered layouts/_refer.html.erb (0.5ms) -Completed 200 OK in 65ms (Views: 14.2ms | ActiveRecord: 1.9ms) - - -Started GET "/chat" for 127.0.0.1 at 2016-11-27 17:08:03 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] - [1m[36mMessage Load (0.1ms)[0m [1m[34mSELECT DISTINCT "messages"."recieve_user" FROM "messages" WHERE "messages"."send_user" = ?[0m [["send_user", 5]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - [1m[36mUser Load (0.0ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 8], ["LIMIT", 1]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.4ms) - [1m[36mMessage Load (0.2ms)[0m [1m[34mSELECT "messages".* FROM "messages" WHERE "messages"."send_user" IN (5, 6) AND "messages"."recieve_user" IN (5, 6) ORDER BY "messages"."create_time" ASC[0m - Rendered chat/index.html.erb within layouts/application (3.1ms) - Rendered layouts/_title.html.erb (0.2ms) - Rendered layouts/_refer.html.erb (0.3ms) -Completed 200 OK in 30ms (Views: 9.2ms | ActiveRecord: 1.4ms) - - -Started GET "/logout" for 127.0.0.1 at 2016-11-27 17:08:06 +0800 -Processing by LoginController#logout as HTML -Redirected to http://localhost:3000/login -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) - - -Started GET "/login" for 127.0.0.1 at 2016-11-27 17:08:06 +0800 -Processing by LoginController#init as HTML - [1m[36mUser Load (0.2ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT ?[0m [["LIMIT", 1]] - Rendering login/init.html.erb within layouts/application - Rendered login/init.html.erb within layouts/application (1.8ms) - Rendered layouts/_title.html.erb (0.3ms) - Rendered layouts/_refer.html.erb (0.4ms) -Completed 200 OK in 11ms (Views: 10.0ms | ActiveRecord: 0.2ms) - - -Started POST "/login?method=post" for 127.0.0.1 at 2016-11-27 17:08:14 +0800 -Processing by LoginController#login as HTML - Parameters: {"utf8"=>"✓", "authenticity_token"=>"ZRpTHbBS67AqwVDV4FF6mEMoKJoBYpi8/PK6/8DqyZ4BTAqkIj7P+0/lsjT5jJr4f/MQIpkpLiGffb0Inp2xqA==", "email"=>"test3@test.com", "password"=>"[FILTERED]", "method"=>"post"} - [1m[36mUser Load (0.3ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "test3@test.com"], ["LIMIT", 1]] - Rendering login/init.html.erb within layouts/application - Rendered login/init.html.erb within layouts/application (0.9ms) - Rendered layouts/_title.html.erb (0.2ms) - Rendered layouts/_refer.html.erb (0.3ms) -Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.3ms) - - -Started POST "/login?method=post" for 127.0.0.1 at 2016-11-27 17:08:24 +0800 -Processing by LoginController#login as HTML - Parameters: {"utf8"=>"✓", "authenticity_token"=>"HCkA6gJk4FSHBLbPqfXAmSz7koL+2WZ1bt46QsLvdAp4f1lTkAjEH+IgVC6wKCD5ECCqOmaS0OgNUT21nJgMPA==", "email"=>"test3@test.com", "password"=>"[FILTERED]", "method"=>"post"} - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "test3@test.com"], ["LIMIT", 1]] - Rendering login/init.html.erb within layouts/application - Rendered login/init.html.erb within layouts/application (0.9ms) - Rendered layouts/_title.html.erb (0.2ms) - Rendered layouts/_refer.html.erb (0.3ms) -Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.1ms) - - -Started POST "/login?method=post" for 127.0.0.1 at 2016-11-27 17:08:34 +0800 -Processing by LoginController#login as HTML - Parameters: {"utf8"=>"✓", "authenticity_token"=>"zG1mT/o/7GIiK49+n94Bs2JIWV7/Qww+vnXd0KSkeouoOz/2aFPIKUcPbZ+GA+HTXpNh5mcIuqPd+ton+tMCvQ==", "email"=>"test110@test.com", "password"=>"[FILTERED]", "method"=>"post"} - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "test110@test.com"], ["LIMIT", 1]] -Redirected to http://localhost:3000/main -Completed 302 Found in 67ms (ActiveRecord: 0.1ms) - - -Started GET "/main" for 127.0.0.1 at 2016-11-27 17:08:34 +0800 -Processing by MainController#show as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 9], ["LIMIT", 1]] - Rendering main/main.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.4ms) - Rendered main/main.html.erb within layouts/application (1.8ms) - Rendered layouts/_title.html.erb (0.2ms) - Rendered layouts/_refer.html.erb (0.3ms) -Completed 200 OK in 10ms (Views: 8.9ms | ActiveRecord: 0.1ms) - - -Started GET "/chat" for 127.0.0.1 at 2016-11-27 17:08:36 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 9], ["LIMIT", 1]] - [1m[36mMessage Load (0.1ms)[0m [1m[34mSELECT DISTINCT "messages"."recieve_user" FROM "messages" WHERE "messages"."send_user" = ?[0m [["send_user", 9]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.4ms) - Rendered chat/index.html.erb within layouts/application (2.4ms) - Rendered layouts/_title.html.erb (0.3ms) - Rendered layouts/_refer.html.erb (0.4ms) -Completed 200 OK in 13ms (Views: 10.3ms | ActiveRecord: 0.2ms) - - -Started GET "/chat" for 127.0.0.1 at 2016-11-27 17:09:04 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 9], ["LIMIT", 1]] - [1m[36mMessage Load (0.1ms)[0m [1m[34mSELECT DISTINCT "messages"."recieve_user" FROM "messages" WHERE "messages"."send_user" = ?[0m [["send_user", 9]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.3ms) - Rendered chat/index.html.erb within layouts/application (2.0ms) - Rendered layouts/_title.html.erb (0.4ms) - Rendered layouts/_refer.html.erb (0.4ms) -Completed 200 OK in 13ms (Views: 10.2ms | ActiveRecord: 0.2ms) - - -Started GET "/logout" for 127.0.0.1 at 2016-11-27 17:09:13 +0800 -Processing by LoginController#logout as HTML -Redirected to http://localhost:3000/login -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) - - -Started GET "/login" for 127.0.0.1 at 2016-11-27 17:09:13 +0800 -Processing by LoginController#init as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT ?[0m [["LIMIT", 1]] - Rendering login/init.html.erb within layouts/application - Rendered login/init.html.erb within layouts/application (1.4ms) - Rendered layouts/_title.html.erb (0.2ms) - Rendered layouts/_refer.html.erb (0.3ms) -Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.1ms) - - -Started POST "/login?method=post" for 127.0.0.1 at 2016-11-27 17:09:24 +0800 -Processing by LoginController#login as HTML - Parameters: {"utf8"=>"✓", "authenticity_token"=>"w7lhu/IBQwZ6DNUjjLgL3qjxRw3ZRqISZg9QJA+u4AKn7zgCYG1nTR8oN8KVZeu+lCp/tUENFI8FgFfTUdmYNA==", "email"=>"test@test.com", "password"=>"[FILTERED]", "method"=>"post"} - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "test@test.com"], ["LIMIT", 1]] - Rendering login/init.html.erb within layouts/application - Rendered login/init.html.erb within layouts/application (1.0ms) - Rendered layouts/_title.html.erb (0.2ms) - Rendered layouts/_refer.html.erb (0.4ms) -Completed 200 OK in 79ms (Views: 7.5ms | ActiveRecord: 0.1ms) - - -Started POST "/login?method=post" for 127.0.0.1 at 2016-11-27 17:09:31 +0800 -Processing by LoginController#login as HTML - Parameters: {"utf8"=>"✓", "authenticity_token"=>"uBU4YZfI41Z19m67bhOQ1L7HGi8kEVl/hyor9t01ge/cQ2HYBaTHHRDSjFp3znC0ghwil7xa7+LkpSwBg0L52Q==", "email"=>"test@test.com", "password"=>"[FILTERED]", "method"=>"post"} - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ?[0m [["email", "test@test.com"], ["LIMIT", 1]] -Redirected to http://localhost:3000/main -Completed 302 Found in 67ms (ActiveRecord: 0.1ms) - - -Started GET "/main" for 127.0.0.1 at 2016-11-27 17:09:31 +0800 -Processing by MainController#show as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] - Rendering main/main.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.4ms) - Rendered main/main.html.erb within layouts/application (2.2ms) - Rendered layouts/_title.html.erb (0.2ms) - Rendered layouts/_refer.html.erb (0.3ms) -Completed 200 OK in 12ms (Views: 10.7ms | ActiveRecord: 0.1ms) - - -Started GET "/chat" for 127.0.0.1 at 2016-11-27 17:09:32 +0800 -Processing by ChatController#index as HTML - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] - [1m[36mMessage Load (0.2ms)[0m [1m[34mSELECT DISTINCT "messages"."recieve_user" FROM "messages" WHERE "messages"."send_user" = ?[0m [["send_user", 5]] - [1m[36mUser Load (0.0ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - [1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 8], ["LIMIT", 1]] - [1m[36mCACHE (0.0ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 6], ["LIMIT", 1]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.4ms) - [1m[36mMessage Load (0.2ms)[0m [1m[34mSELECT "messages".* FROM "messages" WHERE "messages"."send_user" IN (5, 6) AND "messages"."recieve_user" IN (5, 6) ORDER BY "messages"."create_time" ASC[0m - Rendered chat/index.html.erb within layouts/application (3.7ms) - Rendered layouts/_title.html.erb (0.2ms) - Rendered layouts/_refer.html.erb (0.4ms) -Completed 200 OK in 18ms (Views: 11.2ms | ActiveRecord: 0.6ms) - - -Started GET "/chat?chat_with=test2" for 127.0.0.1 at 2016-11-27 17:09:34 +0800 -Processing by ChatController#index as TEXT - Parameters: {"chat_with"=>"test2"} - [1m[36mUser Load (0.2ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 5], ["LIMIT", 1]] - Rendering chat/index.html.erb within layouts/application - Rendered layouts/_nav.html.erb (0.5ms) - Rendered chat/index.html.erb within layouts/application (28.9ms) -Completed 500 Internal Server Error in 56ms (ActiveRecord: 0.2ms) - - - -ActionView::Template::Error (undefined method `each' for nil:NilClass): - 14: 我的联系人 - 15: