このチュートリアルを使用してメールボックスを実装しようとしました。http://www.sitepoint.com/messaging-rails-mailboxer/
「返信」機能がうまく動作しません。返信メッセージは投稿されましたが、毎回これらのエラーが表示されます。指示も出ませんでした。
ArgumentError in ConversationsController#reply
wrong number of arguments (1 for 0)
私の現在のコードは次のとおりです。
conversations_controller.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
show.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 %>
誰が私に何ができるか教えてもらえますか?