zanoni
October 11, 2006, 11:52am
1
I’m somewhat confused on how to set up a select list for observe_field.
Example :
<%=options_from_collection_for_select @states, :id, :name
%>
I want ot get the values when the user chooses them from the list. The
"search[state_id] is not important as it’s from a regular search form.
Just not sure how to name or id these lists so I can set up the
observe_field. Does my question make sense ?
Reading through some observe_field examples I’ve seen for a text_field
it’s
something like this :
<%= text_field_tag(“query”, @params [‘query’], :size => 10 ) %>
Selects are the same ? (And yeah I should try it anyway before asking
Stuart
–
Dark ambient (referred to as ambient industrial especially in the 1980s) is a genre of post-industrial music that features an ominous, dark droning and often gloomy, monumental or catacombal atmosphere, partially with discordant overtones. It shows similarities with ambient music, a genre that has been cited as a main influence by many dark ambient artists, both conceptually and compositionally. Although mostly electronically generated, dark ambient also includes the sampling of hand-pla
The te...
zanoni
October 11, 2006, 7:38pm
2
On Oct 11, 2006, at 2:44 AM, Dark A. wrote:
then observe field on ‘someid’
-Ezra
zanoni
October 11, 2006, 8:24pm
3
So it looks like there is no <%= %> erb ? tags surrounding the select ?
Is that correct ?
Stuart
On 10/11/06, Ezra Z. [email protected] wrote:
then observe field on ‘someid’
-Ezra
–
Dark ambient (referred to as ambient industrial especially in the 1980s) is a genre of post-industrial music that features an ominous, dark droning and often gloomy, monumental or catacombal atmosphere, partially with discordant overtones. It shows similarities with ambient music, a genre that has been cited as a main influence by many dark ambient artists, both conceptually and compositionally. Although mostly electronically generated, dark ambient also includes the sampling of hand-pla
The te...
zanoni
October 12, 2006, 12:56am
4
No we are talking about the same thing. Thanks for your help. Clears up
at
least one piece of the puzzle.
Stuart
On 10/11/06, Ezra Z. [email protected] wrote:
Stuart
fielkd has no dom id to observe. You don’t have to use helpers to
-Ezra
–
Dark ambient (referred to as ambient industrial especially in the 1980s) is a genre of post-industrial music that features an ominous, dark droning and often gloomy, monumental or catacombal atmosphere, partially with discordant overtones. It shows similarities with ambient music, a genre that has been cited as a main influence by many dark ambient artists, both conceptually and compositionally. Although mostly electronically generated, dark ambient also includes the sampling of hand-pla
The te...
zanoni
October 11, 2006, 10:12pm
5
On Oct 11, 2006, at 11:01 AM, Dark A. wrote:
I’m not sure if we are talking about the same thing here. I was just
saying that there is no id tag on your select tag so the observe
fielkd has no dom id to observe. You don’t have to use helpers to
make the select but you do need an id on the select tag. Here ia a
working example that I am using. I like to write out the form
observer JS by hand though as it is more flexible:
<%= select_tag ‘snapshot[version]’,
options_for_select( @snapshot.versions.map {|v|
v.version}, @selected_snapshot.version ),
:id => ‘snapshot_select’%>
<script type="text/javascript">
//<![CDATA[
new Form.Element.EventObserver("snapshot_select", function
(element, value) {
new Ajax.Request(’/apps/snapshot_version/<%= @app.id -%>’,
{asynchronous:‘true’, evalScripts:‘true’, parameters:‘version=’ +
value})
})
//]]>
-Ezra