Hope all is well.
I want to ajax call on _questions_form
. It works without remote: true
option, yet I am using actioncable
Your routes.rb
should generate a routing of
PUT /tasks/complete
mapped to TasksController#complete
but your form is doing a
PUT /tasks
instead (from your log), so there's something wrong with the request (i.e. your form)
Can you try the following:
resources :tasks do
collection do
post :complete
end
end
<%= form_tag complete_tasks_path, format: :js, method: :post, remote: true do %>
<% @in_completed_tasks.each do |task| %>
-
<%= check_box_tag "task_ids[]", task.id %>
<%= task.name %>
<% end %>
<%= submit_tag "Submit your Answers" if @in_completed_tasks.present? %>
<% end %>