Finne Jager wrote in post #968117:
> Marnen Laibow-Koser wrote in post #968112:
>> Bizarre.  new_*_path doesn't normally take an argument (except for an
>> optional format string, which is why you're getting the .16 below).
>
> Is there another way to pass the incident object to the New Timesheet
> method?

new_timesheet_path goes to TimesheetsController#new , not Timesheet.new 
.

The new Timesheet needs to know it's supposed to be attached to
> the Incident.
>
>> What does your routes file look like, or the output from rake routes?
>
> resources :incidents
> resources :timesheets
>
>> Do you have any associations set up between the Timesheet and Incident
>> models?
>
> The Incident model has_one :timesheet

And Timesheet belongs_to :incident , I hope?

>
>> (Both Incident and Timesheet are top level resources.)
>> Perhaps they shouldn't be in this case.
>
> How can I nest them?

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.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to