similar to: Use collection_select

Displaying 20 results from an estimated 200 matches similar to: "Use collection_select"

2006 Aug 09
7
function before_save
Hi everybody I would like a function as the "before_save" method in the model. But it must be the opposite. When I take out data from the database through the model, I want to call a function before the data are available in the controller. Can anyone help me? ---- >>>> thx <<<< ---- -- Posted via http://www.ruby-forum.com/.
2006 Aug 14
3
last record
hi @all Can anyone help me? I would like to read the last two records from a database. In the database I have a table with id, name and sex. How can I read the last two records from the entered names, who are female? There are two conditions I need: > last entries > sex-condition User.find(:all, :condition.....) ?? -- Posted via http://www.ruby-forum.com/.
2006 Aug 03
2
Link to an other model
Hi I a newbie in RoR! So I have an easy question for some of you: I want with the following codeline link to the Admin-Controller. The codeline is on the Product-View with a seperate controller "Product". <%= link_to ''Back'', :action => ''Admin'' %> But it doesn''t work correctly. Can anyone help me? I want to make a simple link!
2006 Aug 08
2
validate data
Can anyone help me?? I validate a form-field: protected def validate errors.add(:name, "should be longer than 2 chars") unless name.length <= 2 end I want to check the variable name. It should have a size over 2 characters. But my function "validate" doesn''t run! Why ??? -- Posted via http://www.ruby-forum.com/.
2003 Jun 04
4
Strip location and grid colour in Lattice
I am probably missing something quite obvious, but any help would be appreciated. I am continually getting people misreading the lattice plots because they are expecting the strip (with the factor names in them) to be below the graph. Is there anyway of achieving this. Secondly, from a more personal note I find the grid formed by the axes to be a bit overpowering and would like to make it a
2011 Nov 20
2
ltm: Simplified approach to bootstrapping 2PL-Models?
Dear R-List, to assess the model fit for 2PL-models, I tried to mimic the bootstrap-approach chosen in the GoF.rasch()-function. Not being a statistician, I was wondering whether the following simplification (omit the "chi-squared-expressed model fit-step") would be appropriate: GoF.ltm <- function(object, B = 50, ...){ liFits <- list() for(i in 1:B){ rndDat <-
2006 Jul 25
8
Calender Script?
I have been trying to get one of the calender javascripts to work with the <%= form.text_field. So when the user pick the date it updates the time fields? (like in normal reservation system where you pick up the date and time from the calender and when user pick the selection it updates the field) but I could not get this to work. Does anyone have got something similar to work? or could
2006 Jun 10
4
collection_select question
How do I specify which option should be initially selected when using the collection_select command? I''ve tried: collection_select(:selectionfilter, :producer_id, Producer.find(:all), :id, :name, {:include_blank => true, :selected_value => @initial_selection}) However it doesn''t return the desired results (the option with the value of @initial_selection selected).
2006 Aug 11
1
- factanal scores correlated?
Hi, I wonder why factor scores produced by factanal are correlated, and I'd appreciate any hints from people that may help me to get a deeper understanding why that's the case. By the way: I'm a psychologist used to SPSS, so that question my sound a little silly to your ears. Here's my minimal example: *********************************************** v1 <-
2006 Nov 17
8
Basic search, quick question
Hi, I know there are other threads about this topic, but I''ve checked and none seem to help my problem. I''m trying to get a simple search to work on my Rails app, but I get a "Couldn''t find Recipe without an ID" error when I search. Here''s what I have: list.rhtml <%= start_form_tag :action => ''find_recipes'' %>
2006 Nov 16
2
Creating and writing to a file
Hey guys, What would be the best way to create and write to a file? 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe
2007 Feb 12
1
Migrations w/o Rails?
Does anyone know if it''s possible to use Active Record migrations in a non-Rails Ruby application (including ActiveRecord of course). Seems like a great tool for creating/maintaining an application database. I''ve tried but no success so far. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby
2006 Jul 27
5
Calculate methods on attr_accessor objects
Is it possible to use the calculate methods (sum, etc.) on attr_accessor attributes? Ie: Class Item < ActiveRecord::Base attr_accessor :total_cost def total_cost @total_cost = self.cost_unit * self.amount end calling Item.sum(:total_cost) or Item.sum(''total_cost'') both return a unknown column ''total_cost'' mysql error. I thought that active
2011 Sep 13
1
Deleting Rows based on Factor and Time Period
Hi All! I have been messing around with this problem for about a week but to no avail! The following data has been cut down in order to make my question reproducible. The alldat data frame includes 2 columns: 1 date column and 1 factor column (equity names)).
2011 May 29
1
Oddity: I seem to have a variable in a dataframe that doesn't show in colnames() - can anyone advise?
I may be being dopey, I surely am, but I'm baffled by this. I've been working, on and off for a few days in R version 2.13.0 (2011-04-13) i386-pc-mingw32/i386 (32-bit) working it through ESS. I've got a dataframe created a couple of days back, during the session: > dim(AllDat) [1] 27270 94 I came back this morning and misremembered my variables and thought I had a variable
2006 Jul 09
5
Tip: searchable Rails api docs from within RadRails!
Just a tip for those of you using RadRails. If you install the new rubygems 0.9.0, you can type "gem rdoc --all --ri" at the command line. Then, open up RadRails, go to Window->Preferences->Ruby->Ri/rdoc and change your ri path to the path to gemri (which gemri). Finally, open up your RI Eclipse view and voila...indexed, searchable rails api docs at your finger tips! This
2006 Jul 24
2
InPlaceSelectEditor question
I''m attempting to use the example given in the Rails Recipes book chapter 2, to create a select drop-down using the InPlaceEditor function (modified to be InPlaceSelectEditor. The example given works (a country list drop-down), but I''m attempting to use it to display a list of items generated from an object in another table that is linked to the table that I''m editing.
2011 Dec 22
1
ff object in lapply function
Hello. I'm using as.ffdf(mydataframe) to create ffdf objects inside an lapply loop and returning that. I then use crbind to combine the lapply results into allData. So...simplified flow looks like this. res <- lapply(1:nchunks, function(n) { blah blah with nth chunk mydataframe <- data.frame(blah blah) dat <-
2004 Jun 29
2
Several PCA questions...
Hi, I am doing PCA on several columns of data in a data.frame. I am interested in particular rows of data which may have a particular combination of 'types' of column values (without any pre-conception of what they may be). I do the following... # My data table. allDat <- read.table("big_select_thresh_5", header=1) # Where some rows look like this... # PDB SUNID1
2006 Jun 24
8
mysql frontend for linux.
Hi list. I''m using Ubuntu distro. for rails development. Today, to my disappoint, I''ve found that there''re certainly almost no mysql frontend which runs very well. (1) mysql-query-browser: Seems to be very nice. But, it quickly exits when I press ctrl+enter or modify a table structure. Something strange is happening here, but I can not figure out what it is. (2)