Passing parameter to new object

People,

I have tables "tickets" and "notes" - tickets has_many notes.

I have added:

  <td><%= link_to 'Add note', new_note_path %></td>

to:

  app/views/tickets/index.html.erb

which works OK but I need to be able to pass the value of ticket.id to
note.ticket_id - how do I do that?

Thanks,

Phil.

Try with,

<td><%= link_to 'Add note', new_note_path(:ticket_id => ticket.id)
%></td>

or

<td><%= link_to 'Add note', new_note_path+"?ticket_id=#{ticket.id}"
%></td>