Displaying 20 results from an estimated 10000 matches similar to: "Using Array or Hash with Form Select and Elsewhere"
2009 Jun 01
2
Xapian .lemony files
Hi All,
I wanted to add a small tweak to my installation of the Query Parser.
Should I be editing queryparser.lemony? I tried that and the make
didn't include my change. I applied the same change to
queryparser_internal.cc and it worked fine. Is the .lemony file
something used internally and I can ignore? Or do I need to run
something prior to make to convert the files?
Thanks,
Mike Boone.
2006 May 24
1
does select support arrays in a form with multiple models?
i have a one-to-many model (an addressbook of contacts with many phone
numbers). i want to represent a select element so that its name is an
array containing the phone_number id...
<select id="phone_number_1_location_or_kind"
name="phone_number[1][location_or_kind]">
<option value="Work">Work</option>
<option
2003 Mar 26
1
formal methods and classes and capitalization conventions
Martin Maechler has suggested that I post this comment to r-devel. It was
originally posted to bioconductor.
---------------------------------
I'd like to raise the issue of a capitalization convention for naming
objects in R. Almost everything in R used to be lowercase but recently
there is increasing use of mixed upper/lower case to define names. There is
potential for using the
2008 Jun 03
0
Editing a serialized hash with a Rails form
I used the "serialize" class method on one of my models to save a hash
in my database. It works fine, but now I would like an easy way to edit
the hash with a form.
I tried to make some googling, but I didn''t find anything about it.
How is this done easily?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this
2005 Nov 21
10
Anybody using SCGI in production?
Or does anybody prefer fastcgi/fcgi? I''m using webrick for development, but plan on using scgi
when I switch to production (because it appears to be an update to fastcgi, and I couldn''t get
fastcgi working anyhow).
thanks
csn
__________________________________
Yahoo! Mail - PC Magazine Editors'' Choice 2005
http://mail.yahoo.com
2013 Sep 30
0
TypeError: no implicit conversion of Symbol into Hash when submitting form to upload files
I''m currently new to Rails and Ruby and I''m trying to learn from my
mistakes, this time I''m trying to upload 2 files from a form for later
processing, however, after I hit the "Submit" button. I keep getting this
error:
TypeError in UploadFilesController#create
app/controllers/upload_files_controller.rb:28:in `new''
2010 Oct 02
2
How to write a test hash for a nested form??
How to write a hash for a nested form??
Example form fields (main model is Practice, nested is User):
practice[name]
practice[users_attributes][0][email]
I want to do this:
post:
post :create, :practice => { :name => "any name", :users_attributes => {
:0 => { :email => "anyone-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" } } }
The issue is that I can not create
2009 Mar 19
1
form_tag params hash doesn't contain form data
Hi,
I have a check box in a non - model based form and when I submit
the form with ''Un Checked'' check box the params hash doesn''t contain
the check box. Whenever I submit the form with the check box
''Checked'', I see the same coming through params hash in my controller.
Since I dynamically generate the form element (Here, check box), if I
2007 Jan 29
0
mock.with(Hash) expects an Array ?
Hi all,
I looked at the open issues on the bug tracker, but couldn''t find
anything related to this. I also searched the archives. And I can''t
believe someone didn''t hit on this before.
Here''s my spec:
context "A project owner" do
controller_name :roles
setup do
controller.stub!(:current_user).and_return(@user = mock("user"))
2006 Mar 25
0
newb: convert contents of sql text field to an array or hash
Hi I have a text field in my sql called: keywords
in it are various keywords (suprise!) ''keywords_1*keyword_2*keyword_3''
etc.
all keyword phrases take_this_format seperated by an asterisk*
In my rails app I would like to populate checkboxes with my keywords to
show that they are already chosen.
can someone please point me in the right direction?
cheers
Peter
--
Posted via
2006 Nov 15
3
using expects with (for Hash and Array)
First off, thanks for the great library.
Is there a way setup expects with this:
runtime_options[:property] = properties_option_string
or do i have to use:
runtime_options.store(:property, properties_option_string)
which results in this:
runtime_options.expects(:store).with(:property, ''prop1=1'')
Thanks for your help.
jeremy
2006 Feb 19
0
Re: can store array or hash in cookies?
Not a bug. A cookie is just a string. You can turn anything into a
string and store it in a cookie. Something very simple like the
following might work for you:
array_for_cookie = [1,4,5,7]
cookies[:foo] = array_for_cookie .to_s
array_from_cookie = cookies[:foo][1..-2].split('','')
(And if you are just storing a single integer in a cookie be sure to
turn it into a
2006 Jan 07
2
can store array or hash in cookies?
Hi
According to rdoc: value - the cookie''s value or list of values (as an
array).
So, I can use arrays, briliant.
But.... It does not work (at least on webrick)
I wrote a controller:
def check_cookies_first
cookies[:chef] =
{:value => ["first", "second"], :expires => Time.local
(2020)}
render_text ":)"
end
def
2007 Sep 05
1
javascript float array in params hash
Hi all
I''m trying to figure out the best way to send the contents of a
javascript array containing floats to the controller and have the
controller correctly interpret it as an array of floats.
So if I have
var points = [1,2,3,4,5,6]
I need to send this to the controller so I can
points_rb = param[:points]
or something similar
thanks
sab
2012 Oct 23
0
multidimensional Array or Hash with group_by 'created_at'
Hello,
i want to create a multidimensional Array or Hash with group_by
''created_at''.
3 dimensions needed:
myArray[week][day][data]
currently i only created it with 2 dimesions:
#model
def self.group_per_day
all.group_by{|t| t.created_at.strftime("%d. %B, %Y")}.sort #"%U" for
Weeks
end
#controller
@pdf_activities = Activity.group_per_day
#view
2005 Dec 09
5
Prototype Enumerable, Array and Hash Documentation
Hey guys,
I recently published an article documenting some of the more useful
and interesting parts of Prototype''s Enumerable, Hash and Array objects.
You can find it here: http://encytemedia.com/blog/articles/
2005/12/07/prototype-meets-ruby-a-look-at-enumerable-array-and-hash
If you have any feedback or suggestions, fire away.
Cheers,
-Justin Palmer
2006 Feb 27
1
Nested hash from form params into create()?
Hi,
I''m really excited about getting the create() method working on a
nested hash. The Rails book make it seem like I''m close to doing the
right thing but I think something very small is not quite right. The
error at the below isn''t giving any hints that I understand.
I have a form that produces a nested params hash and sends it to my
add_to_cart controller method.
2012 May 28
2
Hash Table - Select and Change Data iniside Matrix Using "Between"
Hi,
Here i have been an matrix like this,
*NAME AGE PALCE TRUE/FALSE*
ABC 20 INDIA
XYZ 30 FRANCE
PQR 40 USA
MNO 30 KENIYA
DEF 25 AUSTRALIA
GTY 34 CANADA
BNH 38 JAPAN
Here, *TRUE/FALSE *Column containing empty values.
So my requirement what is, need to change all the TRUE/FALSE
2012 Jun 27
2
Select Helper Array of Array + Filter
Noob alert!
Hi, I am having trouble figuring out how to filter a select helper. The
following shows all of the rows in the table but I would like to filter
the collection from the list_name column (:list_name => "Project
Status"):
@project_status = Valuelist.all.collect {|s| [s.list_value,s.id]}
Thanks in advance, James
--
Posted via http://www.ruby-forum.com/.
--
You received
2007 Jun 06
1
"selected" in form.select
I have a search form in my navbar where a user can select in which
area he wants to search. After clicking the submit-button the
results get rendered but the previous selected area is no longer
selected.
<%= form.select (:suchfeld,
[ [''Beschreibungen'',''description''],
[''Headlines'',''headline'']] )
%>
I was able to