Displaying 5 results from an estimated 5 matches for "option>".
2006 Mar 30
3
Rails 1.1, Markaby, options_from_collection
Last night, I upgraded one of my rails apps to 1.1. This app uses
Markaby exclusively for its'' views, and once I checked out the latest
revisiong of Markaby (r33), everything was working fine except for one
thing:
select_tag(''province_id'', options_from_collection_for_select(@provinces,
"id", "name"))
Now returns this (as you see it is spitting out the options both before
and after the opening select tag):
<option value="2">Alberta</option><br />
<option value="1...
2006 May 22
15
collection_select default selected value
Hiall,
Unfortunately I just can''t find out how to setup a default selected
value when using collection_select. My call is like so:
<%= collection_select(:consultant, :lastname, @consultants, :id,
:lastname, { :selected => @current_consultant.id } ) %>
which is not working, I debugged so far that I know that
@current_consultant.id contains the correct value.
Any tips?
cheers
2005 Oct 26
1
Re: collection_select question about selected_value
...the second item.
> (BTW, using the selected_value as a string doesn¹t work either)
>
> Am I doing something wrong, or is this impossible?
>
> If impossible, any ideas on what other method might get me the
> auto-error-highlighting I want?
select( :client, :company_id,
options_from_collection_for_select(@companies, :id, :name, selected_value=2),
:prompt => "Please select a company..." )
--
We develop, watch us RoR, in numbers too big to ignore.
2010 Jun 17
1
Problem with options_for_select
Hi,
I have a problem with the form select. In the value field I have the
generated html...
<%= f.select :brand_id,
options_for_select([[''Brands'', 0]] +
@search_brands.map { |b| [b.name, b.id]}),
{:id => ''cbxBrand'', :tabindex => (@tabindex += 1)} %>
This is the html:
<select name="search[brand_id]" id="search_brand_id">
<optio...
2010 Sep 17
1
option_groups_from_collection_for_select
Hi,
in my development environment (Ruby 1.87, Rails 2.3.8) the following
code works fine:
<%= select "applicant", "member_1",
option_groups_from_collection_for_select(@topics, :members, :topic, :id,
:name, @applicant.member_1), {:include_blank => true} %>
Producing:
<optgroup label="Clinical Neuroscience">
<option value="1">Prof ...</option>
<option value="2">Prof ......