On Aug 11, 11:43 pm, Rob Wilkerson <[email protected]> wrote: > I have an unexpected nil object that I'll debug, but I don't have a > good feel that I'm doing this the best way. Being completely new to > Ruby and Rails, I don't have a good feel for how to access related > models or what objects are available at which times. For example, I > don't know whether I have to explicitly instantiate a Binary object in > my Image model or, since they're related, I can assume one is > instantiated and access it as self.binary.
You would have to create an instance of Binary. associations just add a bunch of methods that make manipulation objects easier. if you do build_binary that will both create an instance of binary and associate it with the image (ie you don't have have to set self.binary_id). You may want to read the guide about associations at guides.rubyonrails.org Fred > > At this point, I'm fighting the learning curve and may not even be > asking the right questions. Any advice you can offer based on either > the scenario or the posted code would be much appreciated. > > Thanks again. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

