Displaying 13 results from an estimated 13 matches for "selected_valu".
Did you mean:
selected_value
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?
>
> If i...
2006 Aug 13
0
selected_value or select not work
I''am try using collection_select helper, but the option selected_value
not work
i try like this:
<%= collection_select("user", "gender_id", @genders, "id",
"description", {:include_blank => true, :selected_value => "2"}
[]''s
Bruno
--
Posted via http://www.ruby-forum.com/.
2006 Nov 28
2
collection_select and selected_value
...s straight from the example in Pragmatic Programmers
book [2nd ed, p480] copying here for reference.
<%=
@users = User.find(:all, :order => "name" )
form.collection_select(:name, @users, :id, :name)
%>
I went through the api docs and found that there is a way to do this
using selected_value, but an example would be much appreciated.
raj
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@publ...
2006 Jan 11
6
How to display the error messages from the controller
...which consists of two pages. To keep it simple let''s say
that the first page asks the user to select a state from the drop down menu.
In case the user doesn''t select any state, an error message needs to be
displayed.
Ideally I would like to do something like this.
def new
selected_value = params[:addevent][:state_id]
if selected_value == "-1"
errors.add(:state_id,"Please select a valid state")
else
# go to the next page
end
end
But errors is not available in the controller. It''s available only in the
model. I could use flas...
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).
I''ve also tried:
collection_select(:selectionfilter, :producer_id, Producer.find(:all),
:id, :name, {:include_blank => true}, {:selected_v...
2006 Jun 28
6
select_tag
in my controller
@cursos = Curso.find_all
in my view i''m trying to do a select_tag with the results @cursos, using
a helper
select_tag "name" options_for_select(@cursos) --------> not works
select_tag "name" @cursos --------> not works
how to do it, using the helper?
tks
--
Posted via http://www.ruby-forum.com/.
2006 Aug 17
1
2 newbie question
...={:prompt=>"- 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
2008 Jun 08
1
Unable to get selected option with options_from_collection_for_select
I''m in Rails 2.1, Ruby 1.8.6 --
http://pastie.org/211063
<%= params[:doctor_id] %>
<%=
options_from_collection_for_select(Doctor.active, :id, :name, :selected
=> params[:doctor_id]) %>
<%=
options_from_collection_for_select(Doctor.active, :id, :name, :selected_value
=> params[:doctor_id]) %>
Returns:
53
<option value="49">Michael Summer</option>
<option value="52">Susan Miller</option>
<option value="53">Kenny Storm</option>
<option value="55">Tank Bordem</option>...
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
2007 Jan 27
5
Prototype not processing javascript
I''m trying to change over from Rails 1.1.6 to 1.2.1 and have discovered
that either something is wrong with Prototype of else something has
changed that I am not aware of and cannot find documentation on. (I
just joined this group, so if this has already been cussed and
discussed here or in another list then please point me in the right
direction.)
I am trying to use the
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_blank => true)...
2006 Jan 13
4
missing foreign key fields in scaffold views
Is there any reason that foreign key fields do not show in any of the
scaffold views ?
project table:
id serial primary key,
category_id integer,
user_id integer,
name varchar,
morestuff varchar
foreign key (category_id) references categories(id),
foreign key (user_id) references users(id)
scaffold generated views only show name, morestuff fields
2006 Dec 18
13
unit testing wxruby GUIs
paul.allton at uk.bnpparibas.com wrote:
> I''m a big fan of automated UI testing (i.e. driving the UI from some
robot API). I appreciate this
> is potentially a whole new project, but does wxwidgets provide a
method of clicking buttons,
> typing into components ... if so, would it be technically possible to
expose this in wxruby.
I like automated UI testing too, but