0

Just was checking this episode by Ryan Bates (http://railscasts.com/episodes/52-update-through-checkboxes) and it seems that Rails 3.2.x has different setup.

Thus map.resources :tasks, :collection => { :complete => :put } does not produce expected result, as it drops an issue that complete_tasks_path does not exist. Could you please let me know how to customise routing in this particular situation?

Also seems that check_box_tag requires different attributes other than Ryan puts in there. AS it writes back unexpected kEND...

Any help appreciated

Jackie Chan
  • 2,654
  • 6
  • 35
  • 70
  • Please ask one question per question. If you're having some problem with `check_box_tag`, please ask a separate question from your question on routing. – user229044 Sep 25 '12 at 13:33
  • Done! http://stackoverflow.com/questions/12584343/rails-3-2-8-upgrade-checkboxes-from-rails-1-x-x-to-3-2-8 – Jackie Chan Sep 25 '12 at 13:49

1 Answers1

1

It sounds like you want the following which defines a new "completed" action on the collection, accessible at /tasks/completed.

Here are three ways of adding an additional action on the collection

resources :tasks do 
  put :completed, :on => :collection

  # --- OR ---

  collection do
    put :completed
    # additional collection action here ...
  end

  # --- OR ---

  collection { put :completed }
end

This will define a completed_tasks_path method, and route to the completed action of your TasksController.

user229044
  • 232,980
  • 40
  • 330
  • 338