[Rails] Re: Stupid Question - Need to get a field from table...

2009-02-27 Thread Craig Demyanovich
On Fri, Feb 27, 2009 at 1:20 PM, Tony Tony rails-mailing-l...@andreas-s.net wrote: Hi all, I'm ashamed to ask this but I can't figure it out. Lately my brain gets more burned out by the minute. Basically I'm trying to have a shirt have up to 2 colors. I currently have this working. When I

[Rails] Re: Stupid Question - Need to get a field from table...

2009-02-27 Thread Tony Tony
Ideally something like this would be great: %=h @shirt.approved_colors.color_id.name % Any ideas? I don't know why my brain is shot today. Hate it. -Tony -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you

[Rails] Re: Stupid Question - Need to get a field from table...

2009-02-27 Thread Rob Biedenharn
On Feb 27, 2009, at 1:20 PM, Tony Tony wrote: Hi all, I'm ashamed to ask this but I can't figure it out. Lately my brain gets more burned out by the minute. Basically I'm trying to have a shirt have up to 2 colors. I currently have this working. When I edit a shirt, I can select the

[Rails] Re: Stupid Question - Need to get a field from table...

2009-02-27 Thread Tony Tony
Thanks for the replies! Craigs solution worked like a charm. First time I use foreign_key. I have a feeling that while this worked, the way it works (specifically having to specify foreign_key) is incorrect or rather defaults rails conventions. Is this the case? If so what can or should I

[Rails] Re: Stupid Question - Need to get a field from table...

2009-02-27 Thread Craig Demyanovich
On Fri, Feb 27, 2009 at 2:33 PM, Tony Tony rails-mailing-l...@andreas-s.net wrote: Thanks for the replies! Craigs solution worked like a charm. Cool. First time I use foreign_key. I have a feeling that while this worked, the way it works (specifically having to specify foreign_key) is

[Rails] Re: Stupid Question - Need to get a field from table...

2009-02-27 Thread Tony Tony
Craig Demyanovich wrote: Using the :foreign_key option isn't incorrect. It's there if you need to circumvent the Rails defaults for any reason. If you didn't want to use the :foreign_key option, you could use a migration to rename the color_id and color2_id columns in your shirts table to