On Mon, Feb 13, 2012 at 9:43 AM, Nitin A. <li...@ruby-forum.com> wrote:

> I am using rvm on the ubuntu. I am following the rails tutorial from
> Lynda.com
> I was on the section of working in the rails console when i got the
> following errors :-
>
> I gave the command rails console
>
>
> nitin@nitin-vaio:~/Nitin/Sites/app$ rails console
>
> Loading development environment (Rails 3.2.1)
>
> 1.9.2p290 :001 > subject=Subject.new
>  => #<Subject id: nil, subject_name: nil, position: nil, visible: false,
> created_at: nil, updated_at: nil>
>

Your variable name is "subject_name"


>
> 1.9.2p290 :002 > subject.new_record?
>  => true
>
> 1.9.2p290 :003 > subject.name = "History"
> NoMethodError: undefined method `name=' for #<Subject:0x8ab6e9c>
>  from
>

Here, you want to use a variable with name "name".

Could you try:

> subject.subject_name = "History"

You could also change the name of the column with a migration.

HTH,

Peter


-- 
*** Available for a new project ***

Peter Vandenabeele
http://twitter.com/peter_v
http://rails.vandenabeele.com
http://coderwall.com/peter_v

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to