Hey,
I’m trying to observe a field that is inside a form_tag like so:
<% form_tag ‘send_mail’ do %>
<%= select_tag ‘select_club’,
options_from_collection_for_select(clubs,‘id’,‘name’), :class =>
‘ComboBox’ %>
<%= observe_field ‘select_club’,:url=>{:action => ‘clubs_changed’} %>
<% end %>
When I run this in FireFox gives me the following JavaScript error:
Form is not defined
and then points to the generated javascript:
new Form.Element.EventObserver(‘select_club’, function(element, value)
{new Ajax.Request(’/mailings/clubs_changed’, {asynchronous:true,
evalScripts:true, parameters:value + ‘&authenticity_token=’ +
encodeURIComponent(‘06f49bb619c38f8d0ea988932e4324abbd8511ef’)})})
My html does contain a form so I don’t exactly know where to look
anymore.
Thanks!