ruby on rails 3 - Generating routes with polymorphic_url in rails3 -


i've got problems generating routes polymorphic_url

here part of route.rb file :

scope path: '/my-account', controller: 'customers/base', as: :customer   ...   resources :addresses, path: 'my-addresses'   ... end 

rakes routes | grep addresses give me route want :

customer_addresses      /:locale/my-account/my-addresses(.:format) 

now, if use

send('customer_addresses_path) 

in link_to, work fine.

but if i'm not able generate same url polymorphic url :

app.polymorphic_path([:customer,:addresses]) #actioncontroller::routingerror: no route matches {:controller=>"addresses"}  app.polymorphic_path([customer,:addresses]) #"/customer/my-account/my-addresses" not same url :'(  app.polymorphic_path([customer.first,:addresses]) #"/1/my-account/my-addresses" not same url :'( 

is there way use polymorphic_url generate url?

asking question way reflect on it.

solution here:

app.polymorphic_path([:customer,:addresses], locale: :en) 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -