similar to: Default option in collection_select

Displaying 20 results from an estimated 5000 matches similar to: "Default option in collection_select"

2010 Jun 17
3
Can i use a hash on a collection_select? If don't, alternatives.
In my current application, i have food categories: mexican, home made, japanese, ect As these categories only have ID and name, no other attributes, i dont want to create a table on the DB. My first idea was to create a constant named FOOD_CATEGORIES, that is has like: FOOD_CATEGORIES = { 1=>''mexican'', 2=>''japanese'',
2006 Jan 04
2
collection_select with array as source
I would like to use the collection_select with a simply array as the source of the collection. My array looks like this: STATES = ["Alabama", "Alaska", "Texas"] and it is stored in my environment.rb I can''t figure out the syntax for the collection_select in this situation... collection_select("my_object", "state", what goes here??? ) I
2006 Feb 06
10
Urgently Need Solution
I''m using scriptaculous'' SlideUp and SlideDown effects to animate a menu. Specifically, I SlideUp, make some CSS changes, and SlideDown. All works well, except that for a split second in between, the element''s display becomes ''none'' and the other menu item jump into the space. I haven''t been able to find any way to force an element to retain
2008 Apr 28
2
The name/id of the select tag generated by rails
Hi guys, I just recently fell in love with Rails. Now, I''m trying to make a simple page where at list of tasks is presented. Each task has a user. At the top of the list I want to be able to make a select/dropdown list containing all users, so that will be able to select all tasks for a certain user. Looking at the Rails api I find the helper method: collection_select. Just what I
2009 Jan 23
0
:selected option is ignored for collection_select
Is there a workaround for this issue yet? I just wasted a ton of time trying to debug this in an AJAX form. http://rails.lighthouseapp.com/projects/8994/tickets/1037-selected-option-is-ignored-for-collection_select ----------- Reported by YoNoSoyTu | September 12th, 2008 @ 11:07 PM | in 2.3 The :selected option in collection_select is ignored. This patch uses the value of :selected option if
2009 Mar 19
0
How to send multiple values to controller using :with option of collection_select
Hi, Thank u all for replying my previous posts. I have following problem I want to send multiple selected values from collection_select using ":with" option to a controller without submitting the form, i have following code <%= collection_select(:cluster, :CLST_RegionID, regions, :id, :REG_RegionName, {:prompt => "Please Select"},
2008 Jan 12
1
Collection_Select not showing Selected option
Hi, I''m having some problem with getting collection_select to return the current value when editing a record. According to everything I''ve seen, there was an issue but it''s been fixed, but I can''t figure out why it isn''t returning the current value as a selected option. I''ve checked the table structures, and both the call_driver.product_line_id
2006 Apr 27
3
collection_select to display 2 fields
I''m trying to get a collection_select generated Drop-down box to display two fields from a table (first name & last name); however, I am having trouble concatenating the symbols. It appears as though any code I put in the 5th argument for collection_select is processed prior to executing the collection_select method. The code executes successfully with 1 symbol in the 5th
2007 Apr 30
1
collection_select - prepending a "any" option
Say I have a normal <SELECT> tag being generated thusly: <%= collection_select :task, :id, Task.find(:all), :id, :name %> what is the easiest way to add a "ANY" option to the top of the option list? I know Task.find(:all) returns a collection object, so is there a unshift() for that? well OK I tried: Task.find(:all).unshift([:id=>0,
2006 May 24
0
Problems validating form with collection_select
I have the following models: class Comandancia < ActiveRecord::Base has_many :elementos end class Elemento < ActiveRecord::Base belongs_to :comandancia validates_presence_of :nombre, :apellido_paterno, :apellido_materno, :comandancia end In the view for New Elemento I''m using <%= start_form_tag :action => ''create'' %> <%= render :partial =>
2006 Apr 21
0
collection_select has_and_belongs_to_many update_attributes
I know there have been threads on this before but I was thinking shouldn''t multiple collection_select automatically update habtm relations when you update_attributes? In order to get multiple collection_select to work I use: collection_select(:user, :group_ids, Group.find(:all), :id, :name,{},{:multiple=>'''',:name=>''group[id][]''}) In fact if I
2006 Nov 26
0
concatenate fields in collection_select
Hi, I am filling a collection_select with a list of models references based on a column named "model_ref". <%= collection_select(:assets, :model_id, @models, :id, :model_ref,:prompt => ''- Select a model -'') %></p> I have two issues : 1) I would like to concatenate another column next to the model reference inside the option value with the description
2006 Jul 07
3
dynamically updating a listbox from another listbox
Hi, I would like to be able to dynamically (without reloading the page) change the values from one listbox when a user select items from another listbox. I have a model ''Sector'' which has_many ''levels'' (and of cours, ''Level'' beyong_to ''sector''). I want to show the user two listboxes with the sectors and levels. But
2006 Jun 22
2
Setting an index on a collection_select
I am creating a data entry form that allows a user to fill in multiple rows and save them all at once. In my controller, I create an array of "person" objects and pass it to the page. On the page, I have a text field like so: <%= text_field "person", "name", "index" => 1 %> Note the "index" attribute, which sets the name and id
2010 Aug 30
1
update form text_field on collection_select selection
I have form and a collection_select control. I would like to update form fields (text box) when I select an item from the collection_select box. It''s like selecting template from the collection_select and the template automatically loads to text boxes. Any help? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups
2006 Aug 16
1
how to update a collection_select from another
I have two collection_select in my list.rhtml: <%= collection_select (:region, :id, @regionall, :id, :title,html_options={:onChange => "new Ajax.Updater(''related_provinces'',''/categories/related_provinces/" + "?id=''+this[this.selectedIndex].value, {asynchronous:true, evalScripts:true});"}) %><br> <%= render :partial =>
2006 Apr 25
1
simple collection_select problem.
Hi, I can do this : collection_select "state", :id, TrainingState.find_all,:id,:name but not this : collection_select "state[]", :id, TrainingState.find_all,:id,:name Anyone any idea why? Is there something about collection_select that does not allow collections? Thanks Chris -- Posted via http://www.ruby-forum.com/.
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 May 23
0
return value from collection_select
Hi everyone I am trying to get the return value from collection_select helper method. Here is what I did collection_select(''product'', ''product_id'', @products, ''id'', ''name'', {}, {:onchange => remote_function(:url => {:action => :myFunction}, :with => "this[this.selectedIndex].value")}) then in my
2008 Jul 30
0
getting value of collection_select
<%= collection_select(:post, :id, @posts, :id, :title, options ={:prompt => "-Select categories-"}, :class=>"category_dropdown_list") %> Hi, how would I send the value of the selected item in the collection_select? I''m trying to use an observe_field for an input, and in the action I''ll perform the steps corresponding to the collection_select.