Displaying 20 results from an estimated 5000 matches similar to: "Collection_select with multiple options"
2009 Jan 28
3
Apply style in collection_select ?????
Hi to all,
i have this snip i want to apply style to this combo but there is no
effect
help.......
<%= collection_select(:customer,:country_id, @countries,:id, :country,
html_options={ "style" => "width:110px" },:onchange =>
''updateState('''');'',:id =>''country_id'' )%>
Thanks,
--
Posted via
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
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
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 =>
2005 Oct 26
1
Re: collection_select question about selected_value
Paul Welty wrote:
> collection_select(:client, :company_id, @companies, :id, :name, {
> :selected_value => 2 , :prompt => "Please select a company..." })
>
> Returns a functioning SELECT element, but it won¹t select the second item.
> (BTW, using the selected_value as a string doesn¹t work either)
>
> Am I doing something wrong, or is this impossible?
>
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
2005 Jul 21
3
Question about sortables
Hi,
I''m trying to use sortables to sort table rows and move them between
different tables (yes, it''s actual tabular data ;). However, either I
don''t know how to use the tag property of Sortable.create properly, or
it''s only working for li''s. Since it''s probably the first option,
could someone post an example of sorting tr tags and move them
2005 Dec 04
2
Adding sortables dynamically
Hi all,
is there a way to define the containment option for a sortable so
that it is a class name instead of an id list?
I have a case very similar to the sortable lists demo, the only
difference is that I'm adding new list containers dinamically, so
either I need to redo the Sortable.create calls for all new elements
to include the newly added container, or having someway to have them
2005 Dec 08
3
Uncomplete hiding on Firefox 1.5
Hi all,
I have observed the following on Firefox 1.5 (both on XP and OSX):
My page has some div containers that hold sortable ul. The div's also
contain links for showing/hiding the contained ul's. No matter which
effect I use to do the hiding and showing (Fade/Appear, SlideUp/Down,
BlindUp/Down) the hidden ul's don't hide completely, leaving a blank
'trace' behind.
2006 Jul 16
6
using collection_select
hello,
supposing i have a User class that contains a Wibble
class User < ActiveRecord::Base
has_one :wibble
end
in my view i have
<%= collection_select :user, :wibble, Wibble.find(:all), :id, :name %>
when i post, i get an error like
"Wibble expected, got String"
how/where am I supposed to convert this posted wibble_id into a
Wibble, or am I using collection_select
2005 Feb 05
4
Creating collections
I''m trying to create a form where a collection is created, using the
example from the Rails 0.9.5 weblog posting:
http://weblog.rubyonrails.com/archives/2005/01/26/rails-095-a-world-of-
fixes-and-tweaks/
I''m having a bit of trouble. The controller currently looks like this:
class StudentController < ApplicationController
def new
render_text @params.inspect
2005 Oct 04
5
sorting
I just want to confirm that it''s *not* possible to sort <tr>s in
tables....
Jamie
2006 Mar 07
6
how to add onchange javascript event to select field
I would like to add javascript ''onChange'' event handling for a select
field, such as
<%= collection_select("job", "client_id" , @clients, "id", "name") %>
with onChange="xxx"
Anyone know how to make this work?
Thank you,
Scott
--
Posted via http://www.ruby-forum.com/.
2007 Nov 08
3
options_from_collection_for_select
I need to add a blank or dashed field to the
options_from_collection_for_select helper but can''t seem to get it to
work. Tried this, but with no effect:
<%= options_from_collection_for_select @airlines, ''id'', ''name''],
{:include_blank=>true} %>
Anyone know how to do this? Thanks,
-S
--
Posted via http://www.ruby-forum.com/.
2005 Mar 07
6
Automatic timestamping in join tables [596]
Hi,
A few days ago I submitted the following ticket
http://dev.rubyonrails.com/ticket/596
asking that ActiveRecord::Timestamp also apply for the join tables of
habtm.
The answer was that it was left for milestone 1.x, and since I think
that without this functionality rails 1.0 would be incomplete, I''m
raising the issue here to discuss it.
My use case is very simple, I
2005 Dec 05
3
Multi-level drag and drop in scriptaculous?
I am trying to create a screen like Google''s personalized home pages or
start.com, i.e., with draggable sections, with the extra feature that
the child items under the parent headings could be dragged and dropped
from one parent heading to another.
I have set up nested droppable sortables (dropOnEmpty=true) but the
behavior is very inconsistent, i.e, parents do not become droppable
2005 Sep 27
3
Too much recursion
Hey Guys,
I''ve just encountered this error in Firefox will I pulled the latest
scriptaculous rc into project. Sadly, I don''t have a linkable page for
you to look over at the point. My question is what is this error
exactly? My code before this never got it but now it does. My few
searches suggest it''s the browsers way of keeping infinite loops from
happening
2006 Apr 21
1
select box with multiple rows
I want a select box that displays 5 rows instead of one row and a drop down.
so i figure this should work, but it doesn''t.
<%= collection_select(:constellation, :region_id, @regions, :id, :name,
html_options = {:size => ''5''})%>
I am not quite sure how to use that html_options and googling around I didnt
find anything directly on point.
Any suggestions?
2005 Dec 07
3
Addressing a class, rather than an id?
Good day,
I''m trying to use the slider control to resize a pile of images on a
web page. Clever, huh. Bet cha didn''t think of that one!!! :)
But seriously. It seems I want to address a class, rather than the
individual id''s of the images. At this point, I''m getting some
results with something like this:
2005 Jul 06
1
collection_select not selecting the selected item
Hi !
I have Event belongs_to Category. The generated source is:
<p><label for="event_category">Category</label><br/>
<select id="event_category" name="event[category]">
<option value="8">Introduction</option>
<option value="7">Programming</option>
</select></p>
Notice no