Trying to get simple jquery example working for form_remote_tag

I am trying to get a simple rails example working with jquery on
windows. I had a simple example using form_remote_tag which worked
fine using the default Rails scriptaculous and so on. I installed
jrails as mentioned here:

the same example now seems to replace the entire html as if it wasn’t
an ajax call. My render partial causes the partial to replace the
html so that the stuff outside of my search_results div (such as the
entire form and everything else) as well as the div itself disappears.
All that is left on the page is the results returned by the
controller. If I then view the source it just show the results. When I
had viewed the source using scriptaculous the results where not there,
just the original unchanged html. Any ideas on this ?
Here’s my basic controller and view stuff:

=========== index.rhtml ==========

<% form_remote_tag :url => {:controller => ‘test’,

:action => ‘search’}, :update => ‘search_results’ do %>

Search <%= text_field_tag :searchtxt, ‘’ %>

<%= submit_tag ‘Submit’ %>

<% end %>

<%= render :partial => ‘results’ %>

======= source page for index =======


============= test_controller.rb ============

def search

@res = []


.. # various code fills in @res etc

render :partial => 'results'


========== _results.rhtml ============


if @res

@res.each do |r| %>


<%= r[‘ttsummary’] %>

<% end



I figured it out, I needed to copy the files from the plugin folder to
the javascript folder in public

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs