我尝试使用本教程实现邮箱。http://www.sitepoint.com/messaging-rails-mailboxer/
我的“回复”功能效果不佳。回复消息确实已发布,但每次我都看到这些错误。它也没有得到指导。
ArgumentError in ConversationsController#reply
wrong number of arguments (1 for 0)
我目前的代码如下:
对话控制器.rb
def reply
current_user.reply_to_conversation(@conversation, params[:body])
flash[:success] = 'Reply sent'
redirect_to conversation_path(@conversation)
end
路线.rb
resources :conversations, only: [:index, :show, :destroy] do
member do
post :reply
end
end
显示.html.erb
<%= form_tag reply_conversation_path(@conversation), method: :post do %>
<div class="form-group">
<%= text_area_tag 'body', nil, cols: 3, class: 'form-control', placeholder: 'Type something...', required: true %>
</div>
<%= submit_tag "Send Message", class: 'btn btn-primary' %>
<% end %>
谁能告诉我我能做什么?