mailboxer
1.在gemfile中添加
1 | gem 'mailboxer', github: 'mailboxer/mailboxer' |
$ bundle install
$ rails g mailboxer:install
$ rake db:migrate
$ rails g mailboxer:views(发邮件/notification时候的设置,对于message没有页面设置)
2.在model_user中添加
1 | acts_as_messageable |
ps:在rails c上面测试是否安装成功
1 | u = User.first |
3.
1 | resources :conversations do |
4.rails g controller conversations
1 | def index |
- touch app/views/conversations/index.html.erb
index.html.erb 1
2
3
4<h1>所有对话</h1>
<% @conversations.each do |conversation| %>
<%= link_to conversation.subject %>
<% end %>
ps:打开测试