similar to: Custom validation of form fields?

Displaying 20 results from an estimated 400 matches similar to: "Custom validation of form fields?"

2006 Apr 10
3
form_remote_tag can only have one submit button?
I setup a form_remote_tag with several submit buttons, all of them share the same name ( ''do_action'' ) and their values differ. eg. button1 named do_action with value ACTION1 button2 named do_action with value ACTION2, etc No matter which button I press the value passed is always the one defined for the first of these buttons ( the correct value associated with the pressed
2006 Apr 03
4
Layout Question w/ code from vendor library
I am new to Ruby on Rails in general and apologize if this question is trivial and/or has been asked before ( my searches did not turn up any threads ). I am using the cookies function from actionpack which I have located in my vendor/rails/actionpack directory. Using: cookies[:username] and cookies[:password] from within a controller file works just fine, I am able to set and read
2007 Feb 05
1
long jumping out of code in specs
I wrote this abomination just now, and wonder if anyone else has had experience with the pattern behind it. In short, I''m specing an after_create hook on an ActiveRecord model, that calls a bunch of private methods. Instead of stubbing all those private methods (which is verboten anyway, as well as impossible because creating the object which owns those methods is what I''m
2005 May 04
1
Conditional validations
I''ve been working with the problem that Joe Hosteny has been talking about on this list and on the tickets he''s posted (http://dev.rubyonrails.com/ticket/1196) and have come up with a tentative solution that I''d like to bring up here. What if we use a "conditional" parameter in the validates_* methods? Here''s how it would look like in practice:
2006 Apr 03
2
Looking for an example ...
... for overriding the default behavior of scaffold''s builtin create and update handlers. Any help would be grealy appreciated! -Andy -- Posted via http://www.ruby-forum.com/.
2006 Mar 11
0
Ruby-GetText-Package-1.3.0
Hi, Ruby-GetText-Package-1.3.0 is now available. Now ActiveRecord::Column.human_name values translate automaticaly. Changes for RoR --------------- * Improve Local::Object * POSIX, C convert to "en". * Enhance supports of Ruby on Rails. * ActionMailer localization support. * Use GetText function(_() N_() etc) in template. * ISO-2022-JP charset is used when language
2006 Apr 14
11
Whats the best Ajax way to update a textarea''s text?
I am looking for a way to update the text-value within a textarea from an Ajax render call inside of a controller. Is there a way to do this without rendering an the partial containing the textarea? Thanks, Andy -- Posted via http://www.ruby-forum.com/.
2005 Sep 25
2
Problem issue with belongs_tohas_one and error_message_on
Hello I have a problem with relationship with belongs_to - has_one and with error_message_on I have splitted one huge table users into two tables user and profile. In users I''m keeping main fields like id,email,password and in profile there are the rest of fields. Table users: id,email,password Table profiles: id,user_id,publicname, and more ... My models are: - user.rb has_one
2006 Sep 27
2
how to get the message from validates_presence_of
hi, I''ve a model with validates_*_of statements, but I have no idea how to get the :message back, anyone has a clue? Thanks. -- 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
2006 Aug 07
1
Override flash message - help
How can I modify the flash message that is displayed on a validates_* check? I used the :message => "" parameter, but it still gives me an annoying "Test : Please ensure you have entered the test message". I wanted to get rid of the "Test: " and the above "6 errors prohibited this table from being saved" I looked at the source of
2006 Jun 20
1
Possible to check if form field is required?
Hi list, is it possible to check if form field will be required when form is submitted (through validates_presence_of or some other validates_* method)? I could do this manually but it doesn''t seems to me very DRY. For example, I would like to be able to dynamically add asterisk with some helper method if city is required here: City*: <%= text_field
2006 Apr 07
2
errors.add_to_base
What are the limitations on using: errors.add_to_base to display errors in views? I have tried for days to add errors from my object.rb and they never get displayed. class Keyword < ActiveRecord::Base validates_presence_of(:name, :message => "Name is required.") validates_uniqueness_of(:name, :message => "This name is already in use. Please try
2006 Apr 26
0
Validation of params
As we all know you cannot trust anything you receive from the internet. I am wondering what the correct RoR way is to solve this. For the model there are various validates_* methods that you can use to ensure some integrity of that part. That is good by itself. Though it would be nice if setting these would also result in enforcement in the database backend itself when supported. Here I am as
2006 Apr 27
0
DRY validation
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, A few months ago someone posted a message about specifying validates_* constraints on a per-attribute basis. I just created a small plugin that allows you to do this. Here''s an example from one of my models: class Country < ActiveRecord::Base attribute :name, :string do |a| a.validates_length :within =>
2005 May 26
0
Validation of Correct Date Submitted on Form
From what I can tell there is not validates_ functionality for dates is their? Do people just make custom validations for that too or it their a validates_functionality that I am missing? John Kopanas john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org
2006 Apr 03
1
Q: periodically_call_remote ( how to make it execute just once? )
I posted this ealier on the web forums but noticed a similar question about this function and one user responded to try this list instead. If anyone can help I would greatly appreciate your suggestions. Q: Is there a way to use periodically_call_remote to run just one time instead of every '':frequency'' seconds? I tried putting the call inside the div container thinking it
2006 Apr 10
3
form_remote_tag : additional onsubmit funct. possible ?
Is there a way to add onsubmit functionality to a form_remote_tag with an additional javascript directive? eg I''d like for an inline javascript to make the form''s div container hidden as soon as the button is pressed to avoid having it possibly get pressed again ( sometimes the rails response is slow enough for a user to think they need to re-press it ). example: <div
2007 May 19
3
form question
Suppose I have the following models/migrations: class Car < ActiveRecord::Base belongs_to :manufacturer validates_presence_of :manufacturer validates_association :manufacturer end class CreateCars < ActiveRecord::Migration def self.up create_table cars do |t| t.column :name, :string t.column :manufacturer_id, :integer end end class Manufacturer <
2005 Mar 05
2
Vorbis I specification errata
Hi! While implementing a Vorbis I decoder, I have found a few errors in the specification. After making the following changes everything works as advertised, thank you! Errata: 1.) In section 7.2.2 Floor1 header decode (on a side not wouldn't 7.2.2.1 be the logical number here, looking at the overall structure of the document?), step 21 element element ([j] + [floor1_values]) should
2001 Aug 02
0
Fwd: Re: WAVE loader for oggenc and oggdrop]
I am resending this ( for the third time, mispelled vorbis-dev-@xiph.org ), because the last time it didn't make it ( it didn't appear on the web archive at www.xiph.org , the archive of vorbis-list for the current month is broken BTW ) -------- Original Message -------- Subject: Re: [vorbis-dev] WAVE loader for oggenc and oggdrop Date: Wed, 01 Aug 2001 13:44:47 +0200 From: David Balazic