Displaying 2 results from an estimated 2 matches for "my_arr".
Did you mean:
my_app
2008 Jul 21
6
form_for and select ( => f.select)
Hi All
I''m trying to combine the from_for and select helpers
Right now I have
form_for :service, :url => ...... do |f|
select("abc", "xyz_id", @my_arr.collect {|item| [ item, "bla" ] },
{:prompt => "opt1"} )
....
end
What I want to do is something like
....
f.select("abc", "xyz_id", @my_arr.collect {|item| [ item, "bla" ] },
{:prompt => "opt1"} )
....
(this doesn'...
2008 Feb 01
5
ActiveRecord - find
Hi-
What I would like to do is select a single column out of my model, say
the column is called my_column, and store the result in an array,
which it should be, right?
For example, if I do:
@my_arr = Model.find(:all, :select => "my_column")
This should fill @my_arr with all the values from "my_column", right?
So then I can access the data by some_other_variable = @my_arr[0], or
do I have to reference this as an object and do something like
some_other_variable = @my_ar...