Displaying 20 results from an estimated 300 matches similar to: "Multiple Select example?"
2005 Feb 13
5
Select Enumerated Values with FormOptionsHelper
Hey,
I''m new, so apologies if I''ve overlooked obvious resources or violated
any etiquette rules for this list.
Since rails does not support the MySQL enum data type, I''m following
David''s advice of using a varchar and storing the valid values in the
application:
http://one.textdrive.com/pipermail/rails/2005-January/001536.html
So here''s my
2008 May 30
1
Parameters for FormOptionsHelper select vs. FormTagHelper select_tag
I must be missing something when it comes to the parameter differences
between form FormOptionsHelper select and FormTagHelper select_tag.
Code that follows, works perfectly -
<%= f.select :unit, units_to_select(@product), :size=>"20"%>
The following code, does not. The helper function never even seems to
be called.
<%= select_tag "unit",
2009 May 27
9
Contingent Select Boxes - 2 Q's
I have a form with contingent select boxes (the state is contingent on
the country selected, so when the country selected changes, the state
changes -- I am using the Carmen plugin for getting my state names and
country names together, but not the functionality I am interested in
achieving).
Everything works fine except I cannot figure out how to amend my code
such that:
A. When the form is first
2005 Dec 15
3
Rails: Select and html forms
I''m close to getting this to work, but not quite there. I''m trying to
implement a dropdown control, with the current choice selected.
I have the following code in the view:
5 <select id="product_product_type" name="product[product_type]">
6 <%=
7 types = ProductType.find(:all, :order => "product_type")
8
2005 Dec 31
3
Sort or Order a <Select> box.
Evening folks,
I''m new to RoR, and have found some very useful info on this site,
thanks.
I have a select box that I need to sort.
<select name="people[peoplekind_id]">
<% @peoplekinds.each do |peoplekind| %>
<option value="<%= peoplekind.id %>"
<%= '' selected'' if peoplekind.id == @people.peoplekind_id %>>
<%=
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
2006 Jun 16
3
us_states plugin
Hello,
I am trying to figure out how to use the options available with the
us_states plugin. What is the proper syntax for using the :priority
and :with_abbreviation options?
Thanks,
jeremy
2010 Apr 16
1
time_zone_select :priority_zones not working properly
I sent this earlier but I don''t think it ever came through. Sorry if this is a reposting.
When using :priority_zones for time_zone_select in a manner described
by the API docs for ActionView::Helpers::FormOptionsHelper I''m getting
errors.
Here is an API docs example:
time_zone_select( "user", ''time_zone'', TimeZone.us_zones, :default =>
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/.
2006 Jun 05
2
dropdown
I''m using a dropdown on my form for a simple cms which displays the
pages from the database. I want to add some options to the dropdown
that are not in the database. Is there a way to do this?
Here''s my code so far:
<p><label for="navigation_link">Link</label><br/>
<%= select("navigation", "link",
2005 Dec 19
3
Is there a list of html_options for the FormOptionsHelper?
I''m looking for a way to select a default value from a select box, like
this:
select("user", "role_id", Role.find_all.collect {|r| [ r.name, r.id ] },
{ :default_value => ''5'' }
(of course, there is no ":default_value")
If the form is being used on a ''create'' page, it should display a
default in the select box. If
2006 Apr 23
3
custom form builder
In the API docs I found this:
"You can also build forms using a customized FormBuilder class. Subclass
FormBuilder and override or define some more helpers, then use your
custom builder "
I couldn''t find any further documentation on this. Where can I read more
about this formbuilder class? For starters, where would I define a
subclass of this class?
TIA,
Jeroen
--
2006 Feb 19
8
select, first option empty value?
using the below:
<%= select(''project'', ''project_type_id'', @project_types.collect {|x|
[x.name,x.id]}, {:include_blank => true}) %>
but i''d like that first option to have something like "select project
type" with an empty value?
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 Jul 08
10
A rant about parameters
Guys,
I''ve been chasing a problem with country_select for the past few hours
now. My intention was pretty simple...use the following line in a form:
<p><label for="country_region">Country</label>
<%= f.country_select :country_region, "United States" %></p>
However, for the life of me, I couldn''t get it to work. I kept getting
2006 Jul 13
1
what does the ''select(x,y,w) function/command do in Rails?
Hello there, I''m new with Ruby and I''m trying to develop a web app. I''m
following an example from the book and they used ''select( )'' with three
parameters...what exactly does ''select ( )'' do? I''m trying to have a
scroll down button that will let me select one of the options. Is there
another way to accomplish this?
I
2006 Jul 20
4
drop down list
hello friends ,
can u pls tel me how to add drop down list in railsapplication
--
Posted via http://www.ruby-forum.com/.
2006 May 19
1
flickr like DST timezone management
Hello everyone
I wonder if anyone can point me to the library for timezone management
with DST support, which has timezones, like flickr has. I know that
there is TZInfo, but it''s a bit different for it has huge list of
available timezones in ''Continent/City'' format. I would like my
application to have timezones list more like on flickr (or windows
regional settings) -
2006 Apr 05
1
select in *.rhtml
I''m trying to get a select box of categories to appear in my items views
after I created everything using generate scaffold, but I can''t get the
categories to appear in my forms.
class ItemsController < ApplicationController
def new
@item = Item.new
@category = Category.find_all
end
...
class Item < ActiveRecord::Base
belongs_to :category
end
class
2006 Feb 07
1
displaying foreign keys help request
Hi ..
(I seem to be having some problems getting my posts to the list for some
reason. Sorry if you see this as a repost).
A conceptual question this time.
I have the relation:
member (m)---(1) member_type
The schema looks something like this (simplified + PGSQL)
create table member_types (
id serial,
info varchar( 20 ) not null,
primary key( id