Displaying 20 results from an estimated 3000 matches similar to: "file column validates_format_of"
2005 Nov 28
4
validates_format_of nil
I''ve noticed that validates_format_of will return invalid if the field
is nil.
Question 1) How should we declare a validation that will validate it
with a regex if it is set, but, if the field is not set, just move on
Question 2) Why is it done this way? The other validators are only
invoked if the field is set . If you want to declare the field
mandatory, you add a
2006 Feb 21
4
File_Column w/ Dynamic Sizing
I''m running file_column 0.3.1, and having a few problems... which are:
- Uploading a 378x567 jpg, and using :magick => {:geometry =>
"100x100" }, my image ends up being 67x100 ?
Is there a way to "force" the image to be the size you specify ?
- My view has a drop-down of sizes, and I''m trying to pass in this
size into :magick =>
2008 Jun 07
3
DRY validates_format_of?
In a model I have following validates_format_of. Is there an easy way to
DRY this up? It seems to be rather repetitive.
validates_format_of :expiration_date, :with =>
/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/
validates_format_of :activation_date, :with =>
/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/
validates_format_of :some_other_date, :with =>
2006 May 31
0
validates_format error
How does validate work? Is the file uploaded before the format is
checked? I tried uploading a pdf and it crashed the WEBrick. Out
putting this over and over:
**** Warning: Fonts with Subtype = /TrueType should be embedded.
But BookmanOldStyle is not embedded.
Surely the file should have been rejected before it is even uploaded?
Model:
class Image < ActiveRecord::Base
belongs_to :user
2006 Apr 18
4
IN-PLACE FORM EDITING
Ive been following the rails recipes (great book) and wanted to have a
larger a text field when editing in place.
The chapter it mentions that I can "force the InPlaceEditor to create
either a text ?eld or a <textarea> ?eld, using the :rows option to
in_place_editor_?eld( ). Then any value greater than 1 will tell
InPlaceEditor to generate a <textarea>." It
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,
2006 Apr 28
2
file_column with polymorphic table relationship?
Hello,
I''m just starting out with both Rails and Ruby, so I hope this isn''t too
simple of a question - but I''ve been struggling to find a solution.
I''m using the file_column plugin to handle image uploads and thumbnail
generation. In addition, I''ve wrapped the image into a polymorphic table
so I can have uploaded images associated with multiple
2008 Feb 24
1
validates_format_of no dots allowed
I need a validates_format_of that disallow dots.
In the api there is nothing to find about how validates_format_of exatly
works.
Is there a better documentation or is there something that can tell me
howto disallow dots.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2006 Apr 05
4
validates_format_of ?
Hi all,
I''ve got a form which accepts a "price" field and I''m attempting to
validate it and allow some flexibility in the way the user enters it.
It''s a numeric field but I want the user to be able to enter dollar
signs and commas naturally in the data entry.
I''m trying to understand how to use validates_format_of, and I''m not
sure what
2006 May 16
5
Google Map problems
I followed the setup from http://cartographer.rubyforge.org/
but keep getting this error -
NoMethodError in Sandbox#map
Showing app/views/layouts/sandbox.rhtml where line #4 raised:
You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]
Extracted source (around line #4):
1: <html>
2: <head>
2006 Mar 08
3
file_column Cropping -> image offset information
Hello,
I had a problem cropping images with file_column. These are my settings:
file_column :image, :magick => {
:versions => {
:thumb => "80x80>",
:medium => "150x150>",
:square => {
:crop => "1:1",
:size => "50x50!"
}
},
2009 Feb 28
7
be_valid (validates_format_of ..., :on => :create)
Greetings,
How to write Example which will check if model''s variable''s
format is valid using :on => :create, like this:
class User < ActiveRecord::Base
...
validates_format_of :email, :with => /.../, :on => :create
...
Using following code is not right:
it "should ..." do
@user = users(:example_user)
@user.email =
2006 Feb 13
3
file_column: uninitialized constant Magick
I am getting this following error when using file_column with RMagick:
uninitialized constant Magick
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/
active_support/dependencies.rb:200:in `const_missing''
./script/../config/../vendor/plugins/rails_file_column/plugins/
file_column/branches/kyle/lib/file_column.rb:621:in `file_column''
2010 Jan 18
3
validates_format_of :phone,
validates_format_of :phone,
:with => /\A\s*(?:(?:\+?(?:\d{1,3}(?:\s*|[\-.])))?\(?\d{3}[\-\/)]?\s*)
(?:[2-9][0-9 \-.]{6,})\s*\z/,
i pit it on my reuriments but error whlie entering
666.111.9999
i want it should be ok
any one help me please
--
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
2006 Jan 20
4
validates_format_of > Invalid regular expression with simple pattern
Hello,
I try this :
validates_format_of :name , :with => /^[A-z0-9_.- ]*$/ , :message =>
"bad characters"
for accept any name with chars "A" to "z" , "0" to "9" , with "_" "."
"-" and " "
The pattern is really simple but I have this error :
SyntaxError in Login#register
2006 Feb 24
1
File Column
Has anyone any experiance with the FileColumn plugin. I''m trying to
create thumbnails, and also alow non picture uploads. Here''s some
working code, but if I try and upload a zip, it says ''File invalid
image''. Is there anyway of having both image uploads (and thumbnail
generation) while also allowing non image uploads?
class Entry < ActiveRecord::Base
2006 Apr 14
6
Login Generator with Extensible authorisation
I want my web app to have a signup/login generator but have 2 tiers of
users - normal and premium. There seems to be lots of login generator
and engines with scattered tutorials about extensible authorisation and
Im lost as which is the ''best'' or most ''easy to use'' solution. Anyone
had success in this area?
--
Posted via http://www.ruby-forum.com/.
2005 Sep 09
5
file_column: patched for imagemagick and validation
Hi all,
I patched file_column to add imagemagick transformations of uploaded
content. I added an options hash, and it takes the :magick and
:format keys. :magick is a string of imagemagick command line options
for convert (Reference:
http://www.imagemagick.org/script/convert.php). Format is an optional
extension for the finished image. If Imagemagick recognizes the
extension, then it will
2006 Jan 19
0
file_column error: tmp file created but not actual
Hi
When I submit the form with field_column, the actual
image is not
uploaded, only temp files are crreated and I dont see
actual file created and the image file name is not in
the database and get "fieldWithErrors". Then if
submit again, the actual file in created and an
database record is generated.
Here is the log file. I print @params and @wallpaper.
I find the following:
1st
2005 Aug 10
5
validates_format_of on an optional field using :if
Hi there,
I''ve got the following in my model:
validates_format_of :postcode,
:with => /^([a-zA-Z]{1,2}[0-9]{1,2} [0-9]{1}[a-zA-Z]{2})$/,
:message => "is not valid",
:if => :postcode
... but it''s not working - it always insists on validation, even if postcode
is empty. Basically, the postcode field is optional, but if it''s filled in, I
want to