On 2 March 2011 14:34, Peter D Bethke <[email protected]> wrote:
> I've got an issue where i have a search page that passes a field which is 
> then used as the criteria of the search. Problem is, I've set an AR has_many 
> relationship in the model that joins one table to another - both tables have 
> the same column name I'm searching on, so naturally I get an ambiguous error 
> in sql - it doesnt know which column to apply the search to.

If you post the code of your search, then maybe we can offer some pointers.
But essentially, you need to dis-ambiguate (nice made-up word...) by
putting the table name in front of the column name, or by aliasing one
of the fields with "AS".

-- 
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.

Reply via email to