Adam Walters | 18 Jul 05:07

RESTful Question -- Extra Member Routes


Hello,

Still getting my feet wet with Rails, and especially RESTful Rails and
am looking for some help tackling an issue

In routes.rb i have:

  map.resources :houses do |house|
    house.resources :chores, :member => {:complete => :any}
  end

This way when a user goes to mark a chore as complete, i call the
ChoresController:complete action to pull up a form to select who
completed the given chore.

I'm curious as to how i RESTfully update this chore.  I can't use the
update action as that is used by the edit form, plus i need to add some
additional details, such as the completed_at time.

Is there a way to detect in the complete action whether it's a PUT or a
GET request?  Any recommendations on how to RESTfully handle this would
be appreciated.

Thanks!
Adam
--

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane