similar to: UTF-8 and validates_length_of

Displaying 20 results from an estimated 40000 matches similar to: "UTF-8 and validates_length_of"

2007 Mar 29
4
validates_length_of not working with :if ?
Hello, I''m trying to cut down the errors if the guy already getting the empty nickname, so he doesn''t get anything about the nickname is short. validates_presence_of :nickname This below is not working ? validates_length_of :nickname, :within => 4..40, :if => Proc.new { |user| user.nickname.length > 1 } nor this one below? validates_length_of :nickname, :within
2006 Aug 17
2
validates_length_of with char field
I am new to ruby/rails and am having a problem with validates_length_of. It seems to work fine on a varchar field, but when I try it on a char field the extra characters are silently truncated and the message appears that the record was successfully updated. How can I get my app to produce my error message instead? I''ve tried various variations, but here''s one of my tries:
2005 May 29
0
validates_length_of && validates_presence_of: Duplicate error messages?
validates_presence_of :login , :on => :create, :message => "Please enter a login." validates_length_of :login, :within => 3..40, :message => "Login must be a minimum of 3 characters." Right now if the login field is left blank, both these errors get thrown. I assume that setting a conditional for the first one if the second one is thrown, something like
2012 Aug 14
3
validates_format_of :message not working, validates_length_of :message is working
I''m using validates_format_of and the validation I want to do works, but I can''t get an error message to be displayed if the data is invalid: validates_format_of :mobile, :with => /\A[\+0-9]+\Z/, :message => " - Wrong" I have another validation some where else that does display the error message: " - Name is too long" validates_length_of :name,
2005 Nov 02
4
Trouble with Umlauts
I am developing an application in German. This means I have umlauts. When I was using rails version 0.13.1 there seemed to be no further configuration needed for umlauts to be shown correctly. Now I have upgraded to 0.14.2 and the umlauts are being displayed at ''?''s. I changed the encoding of the page and it is UTF-8. I have also tried the steps listed at
2006 May 02
2
Converting from UTF8 to ISO-8859-1 encoding
Please help, I have followed the rails wiki to convert my rails application to use UTF-8: http://wiki.rubyonrails.com/rails/pages/HowToUseUnicodeStrings I am able to succesfully cut and paste Unicode characters from other page, successfully store and display unicode characters. However, my client actually wants ISO-8859-1 encoding, which I''m coming to realize is somehow
2007 Jul 24
13
Problem with validates_length_of an integer
Hello guys, I''m trying to validate the input of an integer from a form, here is a bit of code: This is the definition of the offending column in the migration: t.column :position, :integer, :default => 0, :limit => 3, :null => false And here is how I try to validate it inside de model: validates_length_of :position, :within => 1..3 And this is the exception I get when I
2006 Apr 11
8
Does Rails provide solid support for UTF-8?
I need to use UTF-8 in my app and was wondering if Rails would support it properly. Some sites seem to be saying that it has weak internationalization support. Is this true? If so, where is the problem? What should I look out for? Are there tweaks, plugins or gems that fix the problem? TIA. David -- Posted via http://www.ruby-forum.com/.
2015 Sep 03
0
sieve filtering utf 8 strings
Op 9/2/2015 om 5:03 PM schreef Sergey Schwartz: > Guys, > > I'm completely stuck, so asking for advice. > My user has a sieve script which checks message header if it contains > words in russian like '???? ???????????? ?????????'. > > Pritty simple script > > # rule:[??????????] > if allof (header :contains "subject" "LDS (robot): ????
2011 Sep 21
1
Dovecot failing to parse some UTF-8 encoded attachment filenames, returning empty string instead
Hi, I'm seeing a strange problem with some attachment filenames that are UTF-8 encoded. The problem seems to be related to spaces and/or unusual characters in filenames, like accented characters (or perhaps just to filenames if UTF-8 encoded; I've not explored that fully). These filenames are shown as empty strings in IMAP using Dovecot. I've attached a sample message that exhibits
2006 Apr 23
0
Using unicode_hacks breaks Rails 1.1 RJS
All, I wasted an hour on this, so here''s a quick post to save you from the same. If you are using "unicode_hacks":http://julik.textdriven.com/svn/tools/rails_plugins/unicode_hacks/ for "multi-lingual support":[http://wiki.rubyonrails.com/rails/pages/HowToUseUnicodeStrings/versions/40] (i18n), there''s a gotcha - RJS templates will not work. The culprit is
2005 Dec 09
1
utf-8 BIG problems
hey, ------------------ i have change my db to utf8-general-ci, now all the characters are correct in the database, i need this for exporting to pdf en excel. now i can also import from csv, characters like éàï.... But the display is then fucked up. i get wierd symbols ------------------- Another situation: I have seen a post here to add to environment.rb: $KCODE = ''UTF8''
2006 Feb 05
2
working with rails and unicode
I''m trying to get basic unicode support working using the "Iteration A1" sample application from the "Agile Web Development With Rails" book. Following the "HowToUseUnicodeStrings" wiki document, I have made the following changes: config/environment.rb: # Include your application configuration below $KCODE = ''u'' require
2008 Aug 01
0
Help with Access Control
Hi, I am following the excellent tutorial http://www.railsforum.com/viewtopic.php?id=14216 (post 5) on how to implement an access control feature i.e. only a friend is allowed to view a profile of a particular member. I am not using the restful authentication plugin as the author is using to implement the authentication feature (post 1) in the tutorial. All I am interested in is the post 5
2015 Sep 02
3
sieve filtering utf 8 strings
Guys, I'm completely stuck, so asking for advice. My user has a sieve script which checks message header if it contains words in russian like '???? ???????????? ?????????'. Pritty simple script # rule:[??????????] if allof (header :contains "subject" "LDS (robot): ???? ???????????? ?????????", header :contains "from" "noreply at
2008 Jun 17
0
smbstatus error - Substituting charset 'UTF-8' for LOCALE
Hello all, I have a Samba configured as a member server to Winnt domain. Its using ADS authentication. All was well - but now when I type smbstatus I get the error msg: INFO: Current debug levels: all: True/5 tdb: False/0 printdrivers: False/0 lanman: False/0 smb: False/0 rpc_parse: False/0 rpc_srv: False/0 rpc_cli: False/0 passdb: False/0 sam: False/0 auth: False/0
2013 Sep 07
0
[shoulda-matchers gem] validate_numericality_of_matcher strange behaviour
Hello I have Vacancy model and vacancy_spec test with validates_numericality_of :salary, greater_than: 1 in the model and validate_numericality_of(:salary).is_greater_than(2) in the _spec. When i run rspec spec command tests pass (in some cases and in other they don''t) Why? vacancy.rb ------------------------ class Vacancy < ActiveRecord::Base validates_presence_of :name,
2005 Oct 27
0
Converting OS X UTF-8 NFD to UTF-8 NFC
To make rsync work better when rsyncing between OS X (whose filenames are encoded in UTF-8 NFD form) and just about every other OS (whose filenames are encoded in UTF-8 NFC form), I wrote a little patch for rsync that converts the filenames to NFC before sending them to the other side. It uses libidn for that, and currently has no option to enable/disable this behaviour, but since on OS X all
2011 Nov 24
0
R-2.14.0: read.csv2 with fileEncoding="UTF-8"
Dear R-List, I'm trying to read an UTF-8-encoded text file which works fine under ##################################################################### ### CONFIG 1 > sessionInfo() R version 2.12.1 (2010-12-16) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
2012 Jan 18
1
use of UTF-8 \uxxxx escape sequences in function arguments
While preparing a function that contained non-ASCII characters for inclusion into a package, I replaced all non-ASCII characters with UTF-8 escape sequences (using \uxxxx) in order to make the package portable (and adhere to "R CMD check"). What I didn't expect: when one uses UTF-8 escape sequences in function arguments, one needs to use UTF-8 escape sequences when calling the