Displaying 3 results from an estimated 3 matches for "selected_key".
2006 Aug 17
1
2 newbie question
...t;- Select cat -"}) %>
Ignores the :prompt part while options={:include_blank => true} works.
Any idea what I?m doing work with :prompt ?
2nd question:
How can make my collection_selected to display it''s third key by default?
I know it has something to do with selected_value or selected_key but
I have no idea where to put it (html_options etc...) and how to it
works, I tried but couldn''t figure it out.
Thanx in advance
Pat
2006 Jul 02
0
Problem with select, options_from_collection_for_select for selected items
I''m having problems to make the selected works, i''ve been trying with select
and options_from_collection_for_select.
I''ve tried, :selected, :selected_key, :selected_value, and all i can got
from the doc page (
http://rubyonrails.org/api/classes/ActionView/Helpers/FormOptionsHelper.html#M000399
)
and from wiki.
Code:
select(''informacao'', ''tipo_analise_id'', options, :selected => ''2'',
:include_bl...
2008 Nov 18
0
Scoping option_groups_from_collection_for_select
How can I scope the options returned by
option_groups_from_collection_for_select?
Method calls look like this: option_groups_from_collection_for_select
(collection, group_method, group_label_method, option_key_method,
option_value_method, selected_key = nil)
But say I want to limit the results returned by the option_key and
option_value methods to some particular scope?
For instance, using the sample code in rdoc:
class Continent < ActiveRecord::Base
has_many :countries
# attribs: id, name
end
class Country < ActiveRecord:...