similar to: Help validating non-model fields

Displaying 20 results from an estimated 40000 matches similar to: "Help validating non-model fields"

2006 Aug 12
0
Form Validation with non-model fields
I have a couple of questions. I''m learning Ruby at the same time as Rails, so please forgive me if this is trivial. But when I get non-model related params back from the form, is there a quick and easy way to extract those into local varialbes? i.e. if params has keys fname and lname, to have them extracted into local variables called fname and lname without resorting to: fname =
2006 Jun 12
3
Multiple Form Fields with Same Model?
Hello, I''m trying to create a form that will allow a user to submit a list of phone numbers, but the list is dynamically created. Thus allowing my form to submit an unknown number of phone numbers. Here is some of the code I have been trying: <%= collection_select( "phone[]", "phone_type_id", PhoneType.find(:all, :order => "position"),
2006 Jun 07
1
Validating numericality based on related attribute value?
I have a price attribute in my model which I need to validate as a positive number if the attribute price_terms.requires_value is equal to ''Y'', otherwise price can be blank or zero. Price_terms is a select list which my model table belongs_to. How do I do this? - I tried doing this: validates_numericality_of :price, :if => self.price_term.requires_value.upcase ==
2006 Apr 09
12
Validating two models from one form
Howdy, I''m working on my first RoR project, and I want to build a form. The tricky thing is, this form needs to insert / update against two models, each with their own validation rules. Unfortunately, I''m having an incredible amount of difficulty with the error handling, specifically the fields wrapped in <div class=''fieldWithErrors''></div>
2016 Apr 02
1
R model developing & validating - Open to Discussion
Throughout my R journey I have noticed the way we can use given data to develop and validate a model. Assume that you have given data for a problem 1. train.csv 2. test.csv *Method A* *Combine train+test data* and develop a model using the combined data. Then use test.data to validate the model based on predicted error analysis. *Method B* Use *train data* to develop the model and then use
2008 May 04
1
Validating a mixed-effects model
Hi I constructed a mixed-effects model from longitudinal repeated measurements of lab values in 22 patients seperated into two groups with the groups as fixed effect using lme. I thought about using the jackknife procedure, i. e., removing any one subject and calculating the fixed effect, to assess the stability of the fixed effect and thereby validate the model. I suppose this has been done in
2015 May 11
0
[PATCH 3/3] builder: enable batch mode when validating non-verbose (RHBZ#1180170)
When running gpg to validate a signature, use also --batch in non-verbose mode to avoid the extra "Good signature" messages that are printed by gpg2 even in quiet mode. We are parsing the status output anyway to check the validation result, so this should be harmless (and the full gpg output is printed in verbose mode anyway). --- builder/sigchecker.ml | 2 +- 1 file changed, 1
2006 Mar 22
0
validating composite model keys
I know that I should be able to figure this out by looking at the source, but this "ruby newbie" can''t: I have a model for a table with a 3-column composite key. Is there a way to tell the stock validates_uniqueness_of() helper to validate such a key or do I have to write my own? Thanks, Larry -- Posted via http://www.ruby-forum.com/.
2006 Jan 03
1
validating model without saving
Hi all, I would like to validate my model without actually saving it to the database. Actualy I need it as follows: User enters user details in a post form. When the user submits the form I would like the form to be validated. However, when validation passes, I don''t want to save the model yet, but I would like to store it in Session context. Is this possible at all? And if so, how
2004 Sep 28
2
Validating a Cox model on an external set
Good morning, Sorry to trouble the list. I have a problem I hope to seek your advice on. Essentially, I am trying to 'validate' a multivariate Cox proportional hazards model built in a training set, by testing it on an external test set. I have performed a survfit using the Cox model to predict survival for the test set, and obtained individual predictions for survival time, with
2006 Mar 13
0
Controller handling of Non-model fields
I''m a bit confused about how the Controller works for calls that aren''t intended to be remote (non-Ajax). Specifically, if I don''t want to interact with a Model. Does ":action => whatever" always result in a call to the server? Or is it handled like a javascript function (locally, on the client) in the cases where no Model interaction is needed? For
2008 Feb 12
0
Validate all model fields with validates_numericality_of
hi, I have a rather big table and i need to validate every decimal field in the table to make sure its numeric. Can anyone think of the best way to do this or is it even possible? I dont want to write validates_numericality_of: and then each field in the table seperately. JB -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this
2006 Aug 14
3
validating required fields during an update?
I have a User model with an email attribute. I''m using the following validations: validates_confirmation_of :email validates_format_of :email, :with => RFC822::EmailAddress, :message => "must be a valid address in the form user@domain.com" validates_uniqueness_of :email, :message => "address has already been taken. If you''ve forgotten your
2006 Apr 20
2
Additional Fields in a Join Table
Hi, I am creating an order management web application, and have run into an issue over join tables. I am reading Agile Web Development and it says that I can put additional fields within my join tables, and they give the example of a date field. I want to know if it is possible to do the following: I have an orders table with the order information as well as an orders_items table and an
2005 Nov 01
1
not updating non-changed fields
Hey all, this is kind of a weird question, but is there any way to tell ActiveRecord to not update a field that hasn''t been changed? When I see my executed UPDATE sql, I see it trying to update every single field, regardless of whether its been changed or not. Is there any way to have ActiveRecord update ONLY the changed fields? Thanks guys, Jin
2006 Apr 10
3
How to validate optional fieldset which becomes mandatory?
Hi, I am posting here because a re-read of my ''Agile'' book and quick google around didn''t give me any obvious clues, but I apologise if this has already been asked and answered before... I have an ''invoice address'' fieldset in a form which is entirely optional, however, should the user fill any one of the fields then they effectively all become
2006 Jun 12
2
Validating a non-object attribute in a form via checkbox?
Hi there A user can place an ad with various attributes via a form; however, I want the user to check a box signifying that they''ve read the terms and conditions for use of the site. So the ''terms'' is not an attribute of the Advertisement model. I could check that the user has ticked the box in my controller but would like to bundle this up with the validation
2008 Nov 24
0
XEN Virtualization & Isolation of Guest using ebtables
Hello, The basic details of my host and XEN configuration and network configuration all appear below. Whilst I have come this far, a lot of it has been intuitive so I now have plenty of questions. Firstly I would like some help and clarification with regard to ebtables and especially how it works in a Virtualized environment on Novell SUSE 10 SP1 (1) ebtables Installation ebtables was not
2006 Mar 11
2
How do you display validation errors when validating child models?
I can''t seem to figure out how to get child validation error messages to display. I''m going through the simple blog example DHH uses in his video. In the example, a comment belongs_to a post. Validating posts works fine and the errors are displayed as they should be. When I try to validate a comment using: validates_presence_of :summary It does the proper validation by not
2006 Apr 14
1
Validating Existing Models
I''ve got a user object which has quite a few attributes mapped to the database. As of right now I''ve got some validations in the model like: validates_presence_of :password, :message => "You must specify a valid password." validates_confirmation_of :password, :message => "Password doesn''t match the confirmation." validates_presence_of