views:

248

answers:

1

Hi

I wondered if there's some way to do this

polymorphic_path([@page, @image])

but like this

polymorphic_path([@page, :image_id => 1])

It's for the purposed of refactoring where I'd like to throw various params into the array and where they're null, they're ignored, but otherwise they generate the relevant nested url.

Thanks in advance.

+2  A: 
polymorphic_path(:page_id => @page.id, :image_id => 1)
Simone Carletti
I get `nil_class_path' where I try that.
mark