[rspec-devel] Nested Resources and Views

David Chelimsky dchelimsky at gmail.com
Tue Sep 18 03:37:14 EDT 2007


On 9/17/07, Bryan Ray <bryansray at gmail.com> wrote:
> I'm trying to figure out how to pass in the extra "parameters" to a nested
> resource inside a view spec.
>
> What I have:
> "departments" is a nested resource inside "portals"
>
> URL looks like:
> /portals/:portal_id/departments
>
> Error I'm getting:
> department_url failed to generate from { :controller => "departments",
> :action => "show", :portal_id => nil ....
>
> I think my question is ... How do I pass in the :portal_id to the render
> method inside the view. Because right now it's just nil. I've found how to
> do it inside the controller using the get method ... but nothing about a
> view.

What does the call to department_url look ilke?

>
> Any feedback would be much appreciated.
>
> --
> Bryan Ray
> http://www.bryanray.net
>
> "Programming today is a race between software engineers striving to build
> bigger and better idiot-proof programs, and the Universe trying to produce
> bigger and better idiots. So far, the Universe is winning."
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the rspec-devel mailing list