SimplyRestful bug?

Hi I have my routes set up like this:

map.resource :contact, :path_prefix => “/employers/:employer_id”

so now when I view all contacts for an employer I go to:

/employers/1/contacts

That works. On that page, there’s a problem with the routes:

new_contact_url translates to: /employers/1/contacts/new … so that
works.

But, contact_url(@contact) gives me /employers/3/contacts … which is
clearly wrong. It should give me something like /employers/1/contacts/3

Is this a bug? Or am I missing something? Routes and simply_restful work
fine for me everywhere else.

Thanks
Joerg

Joerg,
Try contact_url(:employer_id => @contact.employer_id, :id =>
@contact.id).

Simply_restful is great but it takes a while to figure out all the
routes the plugin generates. Take a look at Rick O.'s excellent
routing navigator at:
http://weblog.techno-weenie.net/2006/6/19/new-plugin-routing-navigator

Hope this helps,
Zack

Ah right ok - cool that works. Thanks.

Zack C. wrote:

Joerg,
Try contact_url(:employer_id => @contact.employer_id, :id =>
@contact.id).

Simply_restful is great but it takes a while to figure out all the
routes the plugin generates. Take a look at Rick O.'s excellent
routing navigator at:
http://weblog.techno-weenie.net/2006/6/19/new-plugin-routing-navigator

Hope this helps,
Zack

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs