Polymorphic paths #15

Closed
morgz opened this Issue Nov 15, 2011 · 4 comments

Comments

Projects
None yet
3 participants

morgz commented Nov 15, 2011

Couldn't get this to work in controller...

add_breadcrumb @management.name, [:admin, @management]

It resolves the url to:

http://localhost:3000/admin/managements/1/[:admin,%20#<Management%20id:%201,%20name:%20"GLL",%20address_line_1:%20nil,%20address_line_2:%20nil,%20borough:%20nil,%20city:%20"London",%20postcode:%20nil,%20telephone_number:%20nil,%20email:%20nil,%20website:%20nil,%20tldc_id:%20nil,%20tldc_approved:%20true,%20created_at:%20"2011-10-25%2011:33:08",%20updated_at:%20"2011-10-25%2011:33:08">]

morgz commented Nov 16, 2011

You can do this polymorphic_path([:admin, @management]) - seems a shame it can't just take the raw polymorphic but hey I'm not complaining ;)

Owner

weppos commented Nov 17, 2011

In previous Rails versions the url_for helper was able to handle polymorphic paths. It seems things changed recently.

octavpo commented Jun 10, 2012

It's because compute_path doesn't call url_for on arrays. So if you could just add Array to Hash in the compute_path's case, that would fix it.

weppos was assigned Dec 25, 2012

weppos closed this in 0a53485 Dec 25, 2012

Owner

weppos commented Dec 25, 2012

Fixed, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment