On Fri, Sep 17, 2010 at 3:31 PM, Sudhir Vishwakarma <[email protected]>wrote:

> Sorry But I guess I have read all The Associations ..the only thing i
> want to know is there any problem with rails 2.3.5 because when i make
> the associations in 2.3.5 i get the same error
> undefined method `some method' for nil:NilClass"
>
>

You can use "rails console" to start up the RAILS console and look up the
values of various objects and make a decision why you are getting null.
Most probable reason why you are getting null is that "journel_id" value is
not set in Ledger records.

In RAILS console, do:

> Ledger.first
...observe the field values..., look wheher journel_id has valid integer

> Ledger.first.journel
...if you get null, then, journel_id is not correct.  try to set it to a
valid jourenl

> lg = Ledger.first
> lg.journel = Journel.first
> lg.save!
> Ledger.first.jourenl
.....now you should not see null...





>
> Veera Sundaravel wrote:
> > If you are much interested in Rails Associations means, refer these
> > URLs.
> >
> > http://guides.rubyonrails.org/association_basics.html
> >
> http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
> >
> > --
> > Regards,
> >
> > T.Veerasundaravel.
> > http://tinyurl.com/25vma7h
> > @veerasundaravel
> >
> >
> > Sudhir Vishwakarma wrote:
> >> Thanks For the Help  Heinz Strunk.
> >> But i need To Know Is there anything with rails 2.3.5 because to check
> >> wheather i have made any mistake in my application i created a sample
> >> application , and again it was the same error  i got .
> >> waiting for your reply
> >> and one more thing ..i am only a couple of months old to Ruby On rails
> >> .so please if possible suggest me how to make the associations between
> >> tables in rails.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 
Srikanth Shreenivas
http://www.srikanthps.com
@srikanthps

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