Forum: Ruby on Rails NoMethodError

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E12dfefd0c6276a098857d95c024ad7f?d=identicon&s=25 Zkidd (Guest)
on 2007-04-11 02:13
(Received via mailing list)
Why, when I am trying to manually assign permalinks, would I get this
from the ruby console:

s.update_attribute :permalink, 'my-shiny-weblog'
NoMethodError: undefined method `permalink=' for #<Story:0x32361c8>
        from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/
active_record/base.rb:1858:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/
active_record/validations.rb:772:in `send'
        from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/
active_record/validations.rb:772:in `update_attribute'
        from (irb):54
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2007-04-11 02:20
(Received via mailing list)
On 4/10/07, Zkidd <zacharykidd@gmail.com> wrote:
>
> Why, when I am trying to manually assign permalinks, would I get this
> from the ruby console:

If you don't have a permalink field in your db, yes.

Pat

p.s. Actually you get that any time you don't have a permalink= method
(just like it says).  Rails just happens to create that method for you
based on your attributes
This topic is locked and can not be replied to.