Displaying 20 results from an estimated 20000 matches similar to: ":selected option is ignored for collection_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
2007 Jan 11
4
collection_select - how to set selected options?
In a form, I am trying to use collection_select with multiple=true, like
so:
collection_select(:user, :roles, Role.find(:all), ''id'', ''name'', {},
:multiple => true) %>
My multiple select box is rendered fine, but...
I want the select to have the current role options for the user
pre-selected when I view it. So if there are five roles in the database
and
2008 Jan 13
0
Obtain selected value from collection_select
Hi
Im trying to change the layout of a view depending on the value selected
in a collection_select box dynamically. Iow the value selected must be
passed to the controller without any submit buttons beings pressed.
Ultimately I wanna know how to obtain the selected value from
collection_select and refresh this value if the collection is
changed....
Any help would be appreciated!! thx
--
Posted
2007 Apr 15
0
how to obtain the selected value from collection_select
Hi,
I''m want to obtain the selected value from collection_select and to use
it
to display something from the same table or other tables.
There is my short code :
<TR>
<TD><label for="country">country name</label></TD>
<TD><%= collection_select(:country, :country_id,
@countries, :id, :name) %></TD>
</TR>
by selecting a
2007 May 09
0
How can I specify the selected value in collection_select when fieldname different than variable?
Hi all,
I have a relatively simple scenario. I have a form that can have a
list of multiple phone objects in it. I''m trying to get the edit and
entry screens to work with unique field names. I have entry and
record creation working, but I''m still working on edit. Is it
possible for me to specify the value of the selected index to the
"collection_select" method via
2011 Nov 10
1
Auto populate text_fields based on selected item from another collection_select
Hello people
I''m trying to figured this out, but I still can''t do it.
I have a rails 3 app, I''m working with invoices and payments. In the
form for payments I have a collection_select where I display all the
invoices number (extracted from a postgres database), and what I''m
trying to do is when i select an invoice autopopulate others
text_fields (provider,
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"},
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,
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 Mar 12
2
Default option in collection_select
I need a way to set a default in a collection_select. Any way?
--
Posted via http://www.ruby-forum.com/.
2009 Jan 15
2
collection_select not selecting default value
Hi,
I''m trying to create a dropdown using collection_select. However, I cant
seem to get it to select the right option by default.
In my controller I have a setup like this:
@content = Content.new
@content.selection_id = 3
@selections = Selection.find(:all)
In my view I have:
<% form_for :content, @content, :url => { :action => ''create'' } do |f|
%>
2012 Apr 02
0
active admin saving selection from collection_select and passing to controller
hi i am using active admin for my app i have a partial with a drop down
list where the menu and recipe are populated this page is to group the
recipe in a menu _menu_recipe.html.erb
<%= semantic_form_for [:admin, @menu_recipe] do |f| %>
<p>
<%= f.collection_select :recipe_id,
Recipe.all,:id,:name,:prompt => true%>
</p>
<p>
<%= f.collection_select :menu_id,
2006 Jun 09
0
options vs. html options in collection_select
I wanting to add an onchange event handler to collection_select but I''m not
sure how.
The api gives the signature as
collection_select(object, method, collection, value_method, text_method,
options = {}, html_options = {})
I''m not sure, however, if I need to place the desired code in "options" or
"html_options". I''m sure I could just figure it out
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
2011 Jul 05
2
Using Capybara to select from a collection_select call (select tag)
I''m trying to use Capybara to test this. I have a step that goes
When I select "Price Chopper" from "Organization"
And the step definition is
When /^(?:|I )select "(.+)" from "(.+)"$/ do |value, field|
select(value, :from => field)
end
For some reason, I keep getting the error:
cannot select option, no select box with id,
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
2005 Apr 23
0
collection_select: generated select tag not marked on error
When a select tag generated by collection_select has a validation error
the tag isn''t marked in the page. That is, the generated tag looks like
this, say,
<select id="obj_attrib_id" name="obj[attrib_id]">
<option value="1">Option 1</option>
<option value="2">Option 1</option>
</select>
Whereas is should,
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