search for: default_error_messages

Displaying 11 results from an estimated 11 matches for "default_error_messages".

2009 Aug 29
0
default_error_messages error with attachment_fu
Hi, Just a newbie at Rails. Was looking at uploading images using attachment_fu and RMagick on a Windows Vista machine, but was getting this error. Any possible way of fixing this problem? ActiveRecord::Errors.default_error_messages has been deprecated. Please use I18n.translate(''activerecord.errors.messages'') I guess it''s attributed to this line in attachment_fu.rb errors.add attr_name, ActiveRecord::Errors.default_error_messages[:inclusion] unless enum.nil? || enum.include?(send(attr_name)) Can...
2005 Jan 17
5
how to override rails errors messages?
hi, how can i override rails errors mesages (that are in english) to display them in an other language? thanks hangon
2007 Apr 27
3
attachment_fu content_type problem
Hi all.... Admittedly I''m new to Rails and trying to find my way but I''m having an issue with uploading documents with attachment_fu. I have a form where I''m uploading multiple attachments (using AJAX to add file_filed_tags). That seems to work pretty well. The problem is I can''t seem to get the content_type to work as I would expect. For example, if I use
2006 Mar 19
0
Trouble redefining ActiveRecord default error messages
Hello, I''m redefining ActiveRecord::Errors.default_error_messages in order to translate ActiveRecord''s validation messages. I''m putting the redefinition in config/environment.rb. The trouble is that I''ve found that this approach works as long as I''m running in development mode under WEBrick, but not on my ISP under producti...
2006 Jan 16
1
GetText (change default error messages)
Hi, is it possible to change the default error messages? for example from ... errors prohibited this ... from being saved to something else? thanks, trung -- Posted via http://www.ruby-forum.com/.
2007 Aug 18
0
RSpec and acts_as_attachment
..._attributes_valid?'' ./spec/models/../spec_helper.rb:635 :in `create_user_file'' ./spec/models/user_file_spec.rb:11 152 [:size, :content_type].each do |attr_name| 153 enum = attachment_options[attr_name] 154 errors.add attr_name, ActiveRecord::Errors.default_error_messages[:inclusion] unless enum.nil? || enum.include?(send(attr_name)) 155 end 156 end --- David Rice http://www.davidjrice.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070818/72cee8c1/a...
2007 Sep 18
0
distance_of_time_in_words hardcoded strings should be separated for easier localization
...After DHHs talk at RailsConf yesterday, it''s essential that some of you can rectify this patch for ruby on Rails Please help me an have a look at http://dev.rubyonrails.org/ticket/9587 Thanks! Jesper Rønn-Jensen blog: www.justaddwater.dk ===== ActiveRecord::Errors has a placeholder (@@default_error_messages) for messages that can be overridden. Just the same way, the hardcoded time strings should be easily overridden without breaking or re-implementing the logic in distance_of_time_in_words. This patch creates a new placeholder for the hardcoded strings: @@time_messages = { :less_than_x_seconds =...
2006 Dec 29
3
Functional test a "create" action when a validation fails
I''m trying to write a functional test of a "create" action in one of my controllers. In the corresponding model I have a "validates_uniqueness_of :location". In the test case I am constructing I have the create fail with the error "Location has already been taken". Is there a way I can write an assertion like: assert_equal "Location has already been
2006 Jun 13
6
Dead horse: validates_associated
Regarding validates_associated... Let''s say I have: article belongs_to author But for whatever reason, I want an article to also be written anonymously and therefore not require an author. Then I have: Article: belongs_to :author validates_associated :author But I DON''T have validates_presence_of. What I want to do is validate that an author is valid --if it is
2007 Dec 05
5
Active Record, Migration, and Translation
Hi, I think the columns and table in migration should be able to have an optional "display_name" set manually. Something like: create_table :people, {display_name => "Personne"} do |t| t.column :first_name :string, :display_name => "Prénom". end Let me explain my point of view: Rails is a framework made to write programs in English. You see it when you
2006 May 23
11
putting the schema in the model files
THE SCHEMA IN THE MODEL a small write up on ''putting the schema in the model'' This is a write up on an issue best covered in a mailing list thread of Januari 2006 (see the links in the text), I repost it because I think it deserves a place on the agenda. == Why? == I was switching back and forward between the model files and the schema.rb -- off course I have