On 4 March 2010 17:31, mac <[email protected]> wrote:
> thank you again for your reply
>
>
>
>
>
>
>> Did you try my suggestion to use ruby-debug?
>  i havent did that yet will do it as soon as possible and will report
> you back
>
>
>> > more details:
>>
>> > 1) content_master model:
>>
>> > class ContentMaster < ActiveRecord::Base
>> >     has_one :Metadata
>>
>> That should be :metadata not :Metadata
>>
>> > end
>>
>> > 2) metadata model:
>>
>> > class Metadata < ActiveRecord::Base
>> >    belongs_to :ContentMaster, :class_name => 'ContentMaster'
>>
>> That should be :content_master and then the class name will not be needed
>>
>> > end
>>
>> > 3) new action in controller
>>
>> > def new
>> >   �...@content_master = ContentMaster.new
>> >   �...@metadata = @content_master.Metadata.build
>>
>> Should be metadata again.
>
>
> though m beginner in Ruby as well as rails but i have read on some
> blog that rails just convert every simple simple and underscore words
> to camelCase( where required ) so it hardly matters how you write it,
> they are just conventions. Though i know it  is good practise to
> follow conventions but i dont think it makes any error.

I would very strongly suggest following the conventions, it will make
your life much easier.  Also I think that in this case it may at least
in part be the cause of the problem.  Consider the line
@metadata = @content_master.Metadata.build
What is Metadata here?  In the model you have declared
class Metadata < ActiveRecord::Base
so Metadata is a class.  But in the code you are using it as if it
were a member of the ContentMaster class, which it is not, whereas
metadata is (or at least could be, dependent on the table schema).
I suggest that you make the changes I have proposed and try it.

Colin


>
>
> will do ruby debug ( for now i even dont now how to do this  ) , and
> will post back about result or if i found something fruitful their
>
> thank you
>
> --
> 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.
>
>

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