Displaying 20 results from an estimated 200000 matches similar to: "Validation against uploading executables"
2007 Jul 22
3
Retrieving validation messages without making errors
I would like to inform the users about attribute validation conditions
for form fields using title as in <span title= "cannot be blank" >.
The simplest way would be to use the validation error messages already
defined in the models, but I cannot find any way to retrieve these
messages, when no error has been made. The methods I have tried as
errors.full_messages only returns the
2008 Jan 27
2
conditional validation
Hi,
How can I validate user info under certain conditions? For example, I
just downloaded a plug-in that allows me to validate phone numbers,
but what I would like is to only validate the phone number if it is
not blank and if the user_type_id field is equal to one.
How can I achieve such a validation in my user model?
Thanks, - Dave
--~--~---------~--~----~------------~-------~--~----~
You
2007 Sep 27
1
How to call a model object method for validation?
This is the code I''m trying to get to work:
validates_inclusion_of :status,
:in => poll_statuses().keys
def poll_statuses
return {
"closed" => "Closed",
"open" => "Open"
}
end
It says there''s no poll_statuses method in Poll. How do I access this
method? I''ve tried
2009 Jan 23
1
Validation levels
Sometimes I want to show just one error, even when a field fails two or
three validations.
A custom validation method is easy enough, but the helpers are nice and
concise.
So, has anyone found a way of doing this with AR''s validation helpers?
The :if/:unless look promising, but its made harder by validations being
applied in a random order.
- Andy
P.s. The validatable gem has the
2008 Jan 03
1
Validation errors and file uploads
I''ve got a form that contains a number of textfields, as well as a
file upload element.
I''ve noticed that this field doesn''t retain it''s data after validation
errors. While I know html/http doesn''t allow form fields to be pre-
populated per se, it can be faked by stuffing it into the session.
Yuck.
Is there any accepted pattern/best practice for
2006 Nov 30
1
Rails validation - newbie
Hi,
Im getting the following error while attempting to apply valdiation to
email addresses on a form in my rails app:
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.each
Extracted source (around line #39):
36: <fieldset>
37: <legend>Feed subscriptions</legend>
38:
2007 Jun 21
1
Validation Through Multiple Models from one Form
Hey All,
I have a form that submits data to multiple models.
I have
class Man < ActiveRecord::Base
has_many :notes
has_many :contacts
validates_associated :contacts, :notes
validates_presence_of :first_name
validates_presence_of :last_name
class Contact < ActiveRecord::Base
belongs_to :man
validates_presence_of :contact_info
class Note < ActiveRecord::Base
2008 Jan 14
5
Only "form_tag" support uploading file?
Hi, there:
I wanna use plug-in "file_column" to upload image to the server. In
my test app, the view is as follow & it works well:
====================
<h1>New entry</h1>
<%= error_messages_for ''entry'' %>
<% form_tag ''create'', :multipart => true do -%>
<p><label
2008 Aug 27
5
VALIDATION QUESTION
I''m trying to validate a record before save. I''m using one controller
in this case furnii where I have all my calls. The problem is that, the
form containing the field I''m trying to validate resides in the furnii
views. I tried to add validates_presence_of :content (the field name) in
both the furnii model and the ratecomment model but it does not work. I
know there
2009 Mar 03
6
Validation - set focus
hi,
Is there any way to set focus in a particular field, after validation in
rails??
or we have to use only javascript.
For example.,
validates_presence_of :username
(assume there is no username given)
after validation, how can i set focus in that particular username
textbox.
is there any way in rails or should i use javascript.
Thanks.
--------
my ror blog
http://www.srikanthjeeva.blogspot.com
2007 Jun 18
4
polymorphic validation
Hello
I have 2 models.
link.rb
has_many :categories, :as => :categorized
validates_presence_of :name, :url, :created_at, :category
category.rb
belongs_to :categorized, :polymorphic => true
validates_presence_of :name
Everything seems to work. I select my category from a select tag. The
problem is i don''t know how to validate if category is for example empty
(nothing in a
2007 Jun 29
1
attachment_fu validation error
I have this class:
class Logo < ActiveRecord::Base
has_one :something
has_attachment :content_type => :image,
:storage => :db_file,
:max_size => 500.kilobytes
:thumbnails => {:web => ''150x100'', :pdf =>
''150x100''},
:processor =>
2007 May 14
2
Uploading entire directories
Did google a while, but didn''t find a simple, clean solution for uploading
whole, entire directoriy/ies with Rails. Is there any ?
Rigger
--
: : i''m a climber : :
--~--~---------~--~----~------------~-------~--~----~
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
2007 Oct 03
2
Providing HTML in an error message generated by validation
All,
I have some validation that I''m doing in a model.
As part of the error message, I would like to provide an HTML link.
What is the best approach to handling this?
APPROACH 1: One way is to
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::TagHelper
in my model so that I can use link_to to generate my link (obv. I could
hard code HTML as well).
But anyway that
2007 Aug 20
0
Raising errors in plugin-files or UploadColumn Validation
Hi all!
I have a problem with the validation of uploaded images, or, to be more
specific, with raising errors from plug-in files. I am using
UploadColumn to upload pictures. Problem is that it won''t raise errors
when upload e.g. txt-files. It will say "Upload succesfull", the
time-stamp is updated only the picture hasn''t changed.
I looked through the code of the
2008 Feb 12
2
File Uploading using Rails
Here is one tutorial for the beginners to understand how to upload a
file using Rails.
http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm
If you like this tutorial then please send me your feedback.
Thanks
Mohtashim
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
2009 Mar 28
1
Image uploading - upload_column
Hai
I am using upload_column for uploading images. Trying to do the user
registration. For the first time when the user tries to upload image it
works fine. But when try to update the image an error
undefined method `process!'' for #<UploadColumn::UploadedFile:0x6838424>
occurs.
in my view I set the :multipart=>true.
and in controller in the edit action @user =
2008 Feb 28
1
Help needed in uploading file
Hello Friends,
Can anyone help on how can I upload a file/image using scriptaculous? I mean
like Gmail like interface and funtionality?
Thanks in advance.
--Srinix
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to
2008 Feb 02
1
attachment_fu stopped uploading files to S3
Hey everyone,
I''ve been using attachment_fu to upload large media files to S3 with
great success in my rails application. However, it has recently
stopped uploading.
My app appears to be uploading to somewhere, as my browser is
displaying a ''sending request to..." status message for about the
right length of time. The records are also created in my application
database.
2008 Jan 24
1
Uploading files: wrong number of arguments (1 for 0)
I am trying to upload a file (pretty simple stuff right?), but keep
getting the argument error.
I have cross referenced what I have to prior uses and cannot find any
errors with what I have.
---------
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_one_association.rb:18:in
`initialize''