The: <%= javascript_include_tag :defaults %>
Should appear BEFORE the: <%= observe_field :friend, :url => friendships_url, :on => :click %> It's usually placed at your page's <header> section. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sun, Jun 14, 2009 at 6:18 PM, Fernando Perez<[email protected]> wrote: > > I can't make it work. > > <%= text_field_tag :friend %> > > <%= observe_field :friend, :url => friendships_url, :on => :click %> > > <%= javascript_include_tag :defaults %> > > > Raises the error:Can't find variable Form. > > The generated html is: > > <input id="friend" name="friend" type="text" /> > > <script type="text/javascript"> > //<![CDATA[ > new Form.Element.EventObserver('friend', function(element, value) {new > Ajax.Request('http://mysite.com/friendships', {asynchronous:true, > evalScripts:true, parameters:value + '&authenticity_token=' + > encodeURIComponent('...edited...')})}) > //]]> > </script> > -- > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

