On Nov 4, 3:09 pm, sw0rdfish <[EMAIL PROTECTED]> wrote:
> Ok so I tried your way, and I got an error;
>
> compile error
> syntax error, unexpected '(', expecting kEND
> _erbout = ''; form_for :company_phone_number_path( [EMAIL PROTECTED],
> @phone_number] ) do |f| ; _erbout.concat "\n"
>
> So I did a little digging to see the syntax for it, and I came up with
>
> <% form_for( [:company, @trade_item] ) do |f| %>
>
> which seems to do the trick!
Interesting! I should have known that: by using the symbol, instead
of an @ variable, it just uses the name 'company' instead of trying to
inspect the @company class name.
> Quick Q, what does STI stand for, and what's the proper syntax for
> your "version" ?
Sorry: STI = "Single Table Inheritance", the Rails term for using the
"type" column in your table to help Rails figure out the right
subclass for the object corresponding to that row in the table.
I think you're getting the syntax error because you're still using the
array form [EMAIL PROTECTED], @phone]. I just use
company_phone_path(@company, @phone)
where @company and @phone are just passed as regular arguments.
Jeff
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---