similar to: validation for items in a 1 2 many

Displaying 20 results from an estimated 10000 matches similar to: "validation for items in a 1 2 many"

2006 Feb 27
6
One to Many example... please!
Hi, I am pulling my hair out trying to work out how to put together what should be a simple app in rails. The app is to CV''s so I have a table of CV''s and each CV can have multiple skills. Skills are in a 2nd table below; CREATE TABLE cvs( id INT not null AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(30) not null, family_name VARCHAR(30) not null, email
2006 Mar 04
5
has_many and belongs_to example?
Hi! If i have 2 tables i.e. product and images and product has_many images, image belongs_to product - how to create _form.rhtml, new/create and edit/update methods in product controller, so in a single form i can add one product and MANY (let''s assume for now that this number is fixed) images for this product? Pleeeeease help me :) -- Posted via http://www.ruby-forum.com/.
2006 Mar 22
4
How do I substitute variables into class names?
In a partial that renders another partial, I would like to change the items I am rendering based on the content of a variable. So instead of having 5 partials which all have variations on this; <% for @skill in @cv.skills %> <%= render :partial => "skills" %> <% end %> If item = "skill" would like to do something to this effect; <% eval("for
2006 Jun 20
2
Validation error_messages_for problem
I am having trouble getting error_messages_for to work. My controller(relevant parts) looks like def configure @account = session[:account] @user = User.new end def add_new_user_to_account @user = User.new(params[:user]) if @user.valid? session[:account].users << @user end redirect_to :action=> ''configure'' end end and my
2006 Jun 21
2
error_messages_for not displaying validation errors
Hi all, I''ve been searching the web and the list archives for help on this and I''ve found some tips, but I''ve been racking my brain on this for hours. I have a Model, View, and Controller that are handling the uploading of a file to my server. I want to make sure that the description is set and that a file is selected to be uploaded. I have set validates_presence_of
2006 May 02
0
Model validation when using ajax & form_remote_tag...
I am trying to understand why model validation error reporting in Rails is so complicated compared to non ajax model validation. In my normal form I use <%= error_messages_for ''user'' %> in my view and I get a nice error message displayed when the user inputs invalid information into the form. When I convert that form to use Ajax using form_remote_tag the
2006 Jul 21
0
Ajax page.replace_html model validation errors
I have the following setup: A model: that validates using helpers like: validates_presence_of, etc.. A view: called ''new'' which renders a partial The partial: _form which has error_messages_for and a form_remote_tag , submit_tag and end_form_tag An action ''create'': that gets executed via the submit_tag in the _form and which in case it can''t
2009 Oct 07
1
Empty validation error messages?
Hello, I''m have a form and the error messages are not being displayed properly I got a remote_form_for and am trying to show errors like I always do: <%= error_messages_for @user%> but the output is: 4 errors prohibited this user from being saved There were problems with the following fields: * {{attribute}} {{message}} * {{attribute}} {{message}} * {{attribute}}
2006 Jan 18
0
Job posting Default / Springbolt Ruby / Rails developers
Greetings, We are currently hiring experienced Ruby / Rails developers to work with our small team at Default / Springbolt. Below is the job description as shown on our (holding) website: http://www.springbolt.com/jobs.htm Please reply off-list with any interest or questions. Thanks for your time. Guy Below is the job description: London based company seeks Ruby / Rails developers to join
2023 Nov 03
0
new cv package: cross-validation of regression models
Georges Monette and I would like to announce a new package, cv, now on CRAN, which implements cross-validation of regression models. Some of the functions supplied by the package: - cv() is a generic function with a default method and computationally efficient "lm" and "glm" methods, along with a method for a list of competing models. There are also experimental
2023 Nov 03
0
new cv package: cross-validation of regression models
Georges Monette and I would like to announce a new package, cv, now on CRAN, which implements cross-validation of regression models. Some of the functions supplied by the package: - cv() is a generic function with a default method and computationally efficient "lm" and "glm" methods, along with a method for a list of competing models. There are also experimental
2006 Jun 07
1
knn - 10 fold cross validation
Hi, I was trying to get the optimal 'k' for the knn. To do this I was using the following function : knn.cvk <- function(datmat, cl, k = 2:9) { datmatT <- (datmat) cv.err <- cl.pred <- c() for (i in k) { newpre <- as.vector(knn.cv(datmatT, cl, k = i)) cl.pred <- cbind(cl.pred, newpre) cv.err <- c(cv.err, sum(cl != newpre)) }
2008 Jun 09
1
Cross-validation in R
Folks; I am having a problem with the cv.glm and would appreciate someone shedding some light here. It seems obvious but I cannot get it. I did read the manual, but I could not get more insight. This is a database containing 3363 records and I am trying a cross-validation to understand the process. When using the cv.glm, code below, I get mean of perr1 of 0.2336 and SD of 0.000139. When using a
2013 Mar 28
0
using cvlm to do cross-validation
Hello, I did a cross-validation using cvlm from DAAG package but wasn't sure how to assess the result. Does this result means my model is a good model? I understand that the overall ms is the mean of sum of squares. But is 0.0987 a good number? The response (i.e. gailRel5yr) has min,1st Quantile, median, mean and 3rd Quantile, and max as follows: (0.462, 0.628, 0.806, 0.896, 1.000, 2.400) ?
2007 May 11
1
model seleciton by leave-one-out cross-validation
Hi, all When I am using mle.cv(wle), I find a interesting problem: I can't do leave-one-out cross-validation with mle.cv(wle). I will illustrate the problem as following: > xx=matrix(rnorm(20*3),ncol=3) > bb=c(1,2,0) > yy=xx%*%bb+rnorm(20,0,0.001)+0 > summary(mle.cv(yy~xx,split=nrow(xx)-1,monte.carlo=2*nrow(xx),verbose=T), num.max=1)[[1]] mle.cv: dimension of the split subsample
2006 Aug 18
0
AJAX question
Dear all, Help me get a simple AJAX behavior right. I know zero AJAX, thus please advice. Below is a simplification of the real code and I hope I can describe my intention clearly. class StoreController < ApplicationController def show_cart @cart = Cart.new @new_item = CartItem.new end def add_item @new_item = CartItem.new(params[:new_item]) if
2006 Aug 18
0
Simple AJAX question
Dear all, Help me get a simple AJAX behavior right. I know zero AJAX, thus please advice. Below is a simplification of the real code and I hope I can describe my intention clearly. class StoreController < ApplicationController def show_cart @cart = Cart.new @new_item = CartItem.new end def add_item @new_item = CartItem.new(params[:new_item]) if @new_item.valid?
2006 Jul 24
0
Ajax page.replace_html model validation render partial errors
Hi; I have the following setup: A model: that validates using helpers like: validates_presence_of, etc.. A view: called ''new'' which renders a partial The partial: _form which has error_messages_for and a form_remote_tag , submit_tag and end_form_tag An action ''create'': that gets executed via the submit_tag in the _form and which in case it can''t
2007 May 14
1
cross-validation / sensitivity anaylsis for logistic regression model
Hi, I have developed a logistic regression model in the form of (factor_1~ numeric + factor_2) and would like to perform a cross-validation or some similar form of sensitivity analysis on this model. using cv.glm() from the boot package: # dataframe from which model was built in 'z' # model is called 'm_geo.lrm' # as suggested in the man page for a binomial model: cost <-
2008 Sep 26
0
Cross Validation output
Good Day All, I have a negative binomial model that I created using the function glm.nb() with the MASS library and I am performing a cross-validation using the function cv.glm() from the boot library. I am really interested in determining the performance of this model so I can have confidence (or not) when it might be applied elsewhere If I understand the cv.glm() procedure correctly, the