Re: [Rails] Re: Redirect and passing params?

2010-12-15 Thread Jesse
On 12/15/10 12:40 PM, Finne Jager wrote: Just another quick question if you don't mind. I'm trying to manually append a SafetyOfficer to the Timesheet with the Rails console: Incident.first.timesheet.safety_officer<< SafetyOfficer.last This is pulling just the first record found of incident so

[Rails] Re: Redirect and passing params?

2010-12-15 Thread Finne Jager
Just another quick question if you don't mind. I'm trying to manually append a SafetyOfficer to the Timesheet with the Rails console: Incident.first.timesheet.safety_officer << SafetyOfficer.last NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance

Re: [Rails] Re: Redirect and passing params?

2010-12-13 Thread Rob Biedenharn
On Dec 13, 2010, at 3:08 PM, Finne Jager wrote: On a side note, by changing the resources to nested instead of top level, it broke my Index page which shows a list of Incidents and their Timesheets. It pointed out this line of code: <%= link_to 'View Time Sheet',

[Rails] Re: Redirect and passing params?

2010-12-13 Thread Marnen Laibow-Koser
Finne Jager wrote in post #968131: >>> On a side note, by changing the resources to nested instead of top >>> level, it broke my Index page which shows a list of Incidents and their >>> Timesheets. It pointed out this line of code: >>> >>> >>> <%= link_to 'View Time She

[Rails] Re: Redirect and passing params?

2010-12-13 Thread Finne Jager
>> On a side note, by changing the resources to nested instead of top >> level, it broke my Index page which shows a list of Incidents and their >> Timesheets. It pointed out this line of code: >> >> >> <%= link_to 'View Time Sheet', timesheet_path(incident) %> >> -

[Rails] Re: Redirect and passing params?

2010-12-13 Thread Marnen Laibow-Koser
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. >> >> I

[Rails] Re: Redirect and passing params?

2010-12-13 Thread Marnen Laibow-Koser
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. >> >> I

[Rails] Re: Redirect and passing params?

2010-12-13 Thread Finne Jager
Thank you, I appreciate your help so far, I feel like we're getting there! > 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,

[Rails] Re: Redirect and passing params?

2010-12-13 Thread Marnen Laibow-Koser
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 >

[Rails] Re: Redirect and passing params?

2010-12-13 Thread Finne Jager
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? The new Timesheet needs to know it

[Rails] Re: Redirect and passing params?

2010-12-13 Thread Marnen Laibow-Koser
Finne Jager wrote in post #968107: > I have two forms that people need to fill out, an Incident form and a > Timesheet form. I want the Timesheet form to appear right after a user > submits the Incident form. > > This is my code for the Incident controller; > ---