[rspec-devel] Nested Resources and Views

Bryan Ray bryansray at gmail.com
Tue Sep 18 09:37:11 EDT 2007


The department_url looks like:
department_url(params[:portal_id], @department)

I finally figured it out .... I woke up the next morning and it was just
kind of obvious. For the life of me I just couldn't figure out how to pass
it the extra parameters.

I just had to pass in the params[:portal_id] = "1" in the before (or where
ever) and it was happy.

Thanks, David.

-- 
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."

On 9/18/07, David Chelimsky <dchelimsky at gmail.com> wrote:
>
> 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
> >
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>



-- 
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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20070918/09d20afc/attachment.html 


More information about the rspec-devel mailing list