Hi,
I am facing a problem with active record validations.
I have a coupon model, which has following validation:-
#coupon.rb
class Coupon < ActiveRecord::Base
validates_presence_of :vendor_id, :message=>":Select a vendor"
validates_presence_of :coupon_code, :message=>":Coupon code should not
be blank."
end
Validations are working but whenever it gets rendered on browser it is
not showing the actual message. It is showing like as follows:-
"
There were problems with the following fields:
* {{attribute}} {{message}}
* {{attribute}} {{message}}
* {{attribute}} {{message}}
"
Also, I have tried to print the error on console but it does not have
any difference.
My gem list is as follows:-
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
authorize-net (1.5.2)
i18n (0.5.0)
json (1.4.6)
mechanize (1.0.0)
mysql (2.8.1)
nokogiri (1.4.4)
rack (1.2.1, 1.1.0)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (2.3.8)
railties (3.0.3)
rake (0.8.7)
-----------------------------------------------
Can anyone tell me what is wrong with it.
Thanks,
Tushar
--
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
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 this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
On 8 February 2011 12:00, Tushar Gandhi <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > I am facing a problem with active record validations. > I have a coupon model, which has following validation:- > #coupon.rb > class Coupon < ActiveRecord::Base > validates_presence_of :vendor_id, :message=>":Select a vendor" > validates_presence_of :coupon_code, :message=>":Coupon code should not > be blank." > end > > Validations are working but whenever it gets rendered on browser it is > not showing the actual message. It is showing like as follows:- > > " > There were problems with the following fields: > > * {{attribute}} {{message}} > * {{attribute}} {{message}} > * {{attribute}} {{message}} > "I believe this is an internationalisation problem. I don''t know the details as I don''t use Internationalisation, but hopefully this will send you down the right track. Colin -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Are you saying it is due to gem "i18n". Thanks, Tushar -- 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 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, After uninstalling the "i18n" gem it is working fine. Thanks, Tushar -- 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 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.