Hello,
I have now Rails Enterprise Edition installed on Centos 6.
And I try to follow this tutorial :
http://guides.rubyonrails.org/getting_started.html
I have this model :
class Post < ActiveRecord::Base
attr_accessible :content, :name, :title
validates :name, :presence => true
validates :title, :presence => true,
:length => { :minimum => 5 }
end
But when I do these steps I get another output as expected.
rails console
Loading development environment (Rails 3.2.8)
irb(main):001:0> p = Post.new(:content => "A new post")
=> #<Post id: nil, name: nil, title: nil, content: "A new post",
created_at: nil, updated_at: nil>
irb(main):002:0> p.save
(0.1ms) begin transaction
(0.1ms) rollback transaction
=> false
irb(main):003:0> p.errors.full.message
NoMethodError: undefined method `full'' for
#<ActiveModel::Errors:0x2deaf88>
from (irb):3
Where I expect this output :
>> p = Post.new(:content => "A new post")
=> #<Post id: nil, name: nil, title: nil,
content: "A new post", created_at: nil,
updated_at: nil>>> p.save
=> false>> p.errors.full_messages
=> ["Name can''t be blank", "Title can''t be
blank", "Title is too short
(minimum is 5 characters)"]
Cam anyone tell me what I did wrong?
Roelof
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/Bz-7FnBiUmkJ.
For more options, visit https://groups.google.com/groups/opt_out.
It''s just .full_messages not .full.messages :) :) :) :) :) :) On 5 September 2012 17:09, roelof <rwobben-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> Hello, > > I have now Rails Enterprise Edition installed on Centos 6. > And I try to follow this tutorial : > http://guides.rubyonrails.org/getting_started.html > > I have this model : > class Post < ActiveRecord::Base > attr_accessible :content, :name, :title > > validates :name, :presence => true > validates :title, :presence => true, > :length => { :minimum => 5 } > > end > > But when I do these steps I get another output as expected. > rails console > Loading development environment (Rails 3.2.8) > irb(main):001:0> p = Post.new(:content => "A new post") > => #<Post id: nil, name: nil, title: nil, content: "A new post", > created_at: nil, updated_at: nil> > irb(main):002:0> p.save > (0.1ms) begin transaction > (0.1ms) rollback transaction > => false > irb(main):003:0> p.errors.full.message > NoMethodError: undefined method `full'' for #<ActiveModel::Errors:0x2deaf88> > from (irb):3 > > Where I expect this output : > > >> p = Post.new(:content => "A new post") > => #<Post id: nil, name: nil, title: nil, > content: "A new post", created_at: nil, > updated_at: nil> > >> p.save > => false > >> p.errors.full_messages > => ["Name can''t be blank", "Title can''t be blank", "Title is too short > (minimum is 5 characters)"] > > > Cam anyone tell me what I did wrong? > > Roelof > > > > > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/Bz-7FnBiUmkJ. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- -------------Regards--------------- G SubbaRao ( Ruby Developer <http://railsdocuments.blogspot.in/>) E-Mail:subbarao.kly-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://railsdocuments.blogspot.com https://twitter.com/g_subbarao -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Thanks, stupid mistake at my site. Op woensdag 5 september 2012 13:39:48 UTC+2 schreef roelof het volgende:> > Hello, > > I have now Rails Enterprise Edition installed on Centos 6. > And I try to follow this tutorial : > http://guides.rubyonrails.org/getting_started.html > > I have this model : > class Post < ActiveRecord::Base > attr_accessible :content, :name, :title > > validates :name, :presence => true > validates :title, :presence => true, > :length => { :minimum => 5 } > > end > > But when I do these steps I get another output as expected. > rails console > Loading development environment (Rails 3.2.8) > irb(main):001:0> p = Post.new(:content => "A new post") > => #<Post id: nil, name: nil, title: nil, content: "A new post", > created_at: nil, updated_at: nil> > irb(main):002:0> p.save > (0.1ms) begin transaction > (0.1ms) rollback transaction > => false > irb(main):003:0> p.errors.full.message > NoMethodError: undefined method `full'' for #<ActiveModel::Errors:0x2deaf88> > from (irb):3 > > Where I expect this output : > > >> p = Post.new(:content => "A new post") > => #<Post id: nil, name: nil, title: nil, > content: "A new post", created_at: nil, > updated_at: nil> > >> p.save > => false > >> p.errors.full_messages > => ["Name can''t be blank", "Title can''t be blank", "Title is too short > (minimum is 5 characters)"] > > > Cam anyone tell me what I did wrong? > > Roelof > > > > > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/KWtmGOB7nX4J. For more options, visit https://groups.google.com/groups/opt_out.