Monday, December 13, 2010

[Rails] Re: Redirect and passing params?

Finne Jager wrote in post #968122:
> Thank you, I appreciate your help so far, I've been struggling with this
> for days now.
>
>> And Timesheet belongs_to :incident , I hope?
>
> Correct.
>
>> See the routing documentation. Once you *do* nest them, you get the
>> routes you need for free.
>>
>> If you don't want to nest them, other solutions are possible, but I'd
>> advise nesting if it's feasible for your project.
>
> Ok, I have nested them like this:
> ----------------------------
> resources :incidents do
> resources :timesheets
> end
> ----------------------------

Something else I just realized. Since Incident :has_one Timesheet, you
probably want a singular resource -- resource :timesheet instead of
resources :timesheets . Again, please check the docs rather than taking
my word for it.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate