Displaying 20 results from an estimated 42 matches for "formoptionshelp".
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", units_to_select(@produ...
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 on Rails: Talk" group.
To post to this group, send email to rubyonra...
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 w...
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 =>
"Pacific Time (US & Canada)")
When using this code I get "uninitialized constant
ActionView::CompiledTemplates::...
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
...amed "format". It''s a varchar, but only the following values are
valid: ["open", "womens", "coed"]. Naturally, I want to have an HTML
select element on the edit page that contains the valid values, and is
set to the current value. It seems like FormOptionsHelper#select should
do exactly what I want, so I tried this:
<%= select("division", "format", ["open", "womens", "coed"]) %>
But that gets a "raised too few arguments" error. Based on this HOWTO:
http://wiki.rubyonrails.com/rails/sh...
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
ActionView::CompiledTemplates::TimeZ...
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
...f 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
ActionView::Helpers::FormOptionsHelper::options_for_select(the_map, current_id)
but this didn''t work.
Any ideas?
Thanks,
Peter
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
...>
Now, looking at the api docs, it says:
----
*country_select*(object, method, priority_countries = nil, options = {},
html_options = {})
Return select and option tags for the given object and method, using
country_options_for_select
<http://api.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelper.html#M000406>
to generate the list of option tags.
----
How was I to know it should have been an array? Had I not been so tired,
I would''ve probably infrerred it from the parameter''s pluralization.
Additionally, after figuring out the problem, I noted
country_options_for_...
2006 Aug 16
14
Migrations: only one table per migration file?
...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 do |c|
Country.create :name => c # Fill in some content
end
So far so good... but I experienced that when the code, that fills in
the countries into the table throws an exception, then the whole
migration is only particularly succeeded, what means, that the stuff,
that su...