Displaying 20 results from an estimated 42 matches for "formoptionshelpers".
Did you mean:
formoptionshelper
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",
2006 Dec 19
0
Calling FormOptionsHelper select method in controller
All,
I know that it is _wrong_ for me to do it, but I would like to know what
is the easiest way for me to call the select() method in
ActionView::Helpers::FormOptionsHelper from within a controller?
Thanks,
Wes
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
2007 Oct 23
0
Noob Question: Problems with FormOptionsHelpers
Hi!
I have problems to see existing values in several FormOptionsHelpers..
(text_area or select for example):
<% @models.each do |model| %>
<% form_for "model", model, :url => { :action => :update } do |f| %>
<%= f.text_field :name %> // works
<%= text_area "model", "text" %> // doesn''t work...
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
2005 May 17
2
Noob - ActionView::Helpers::FormOptionsHelper::select
Hi,
I''m just starting with Rails and i''m trying to do something like this:
<%= start_form_tag :action => ''add_user'', :id => @social_event_group %>
<%= select ''user'', ''id'' , User.find_all.collect {|u| [ u.login, u.id ]
}%></p>
<%= submit_tag "Add User" %>
<%= end_form_tag %>
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 =>
2005 Nov 15
2
FormOptionsHelper select call failing
In Rails 0.14.3, I''m doing the following in a view:
<%= select ''folder'', ''format'', [''a'', ''b'', ''c''] %>
This line in is failing with:
ActionView::TemplateError (too few arguments.)
Am I calling select incorrectly? (Yes, the @folder object does exist,
and does have an attribute
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
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
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/.
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
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",
2010 Apr 15
0
[Rails v3] time_zone_select :priority_zones not working properly
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 =>
"Pacific Time (US & Canada)")
When using this code I get "uninitialized constant
2006 Apr 26
2
Multiple Select example?
I''ve been trying to sort out a multiple select dropdown but haven''t
found any good examples - anyone know of any or perhaps could make a
suggestion [see below]
Model:
1. Task AR has_many users
2. User AR belongs_to task
login/password attributes
Controller:
View:
<%= collection_select("task", "users" , @users, "id", "login", {},
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 Mar 16
4
calling an actionview method from inside a model
Hi,
I would like my model instance to produce it''s own list of options for
a form select. This is from a product model that has_many variations
def alts_for_select(current_id)
the_map = variations.map{|v| [v.name, v.id]}
options_for_select(the_map, current_id)
end
the model cannot see the options_for_select method
I tried to use
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?
2011 Mar 10
4
Multi-model forms
Hi guys, I''m new to ruby and rails and I''m working on multi model
forms, specifically 3. I''m using this http://guides.rubyonrails.org/getting_started.html
as a start, and its got a 2 Model example but I cant seem to get the
last one working.
These are my models:
Country name:string code:string (has_one :address)
Address address_line1:string
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 Aug 16
14
Migrations: only one table per migration file?
Hi all
I have a new migration file created that adds some tables and fills one
with some data:
create_table :sound_styles do |t|
t.column :name, :string, :null => false
end
create_table :show_types do |t|
t.column :name, :string, :null => false
end
create_table :countries do |t|
t.column :name, :string, :null => false
end
ActionView::Helpers::FormOptionsHelper::COUNTRIES.each