I have a query form that performs a complex SQL query based on form
params and then creates a bunch of @user_x collections for display
purposes. However, AJAX is bombing out with what seems to be a simple
error. When I submit the form, instead of replacing the desired partial
(under the form) it displays:
======
try {
Element.update("CONTENTS OF PARTIAL SNIPPED);'); throw e }
======
The partial correctly updates but something small is wrong preventing
the in-place update.
FORM VIEW
<%= javascript_include_tag :defaults %>
<% form_for :query, :url => {:action => :query_results} do |f| %>
FORM CONTENTS SNIPPED
<% form_remote_tag :url => {:action => :query_results} do %>
<%= submit_tag "Query" %>
<% end %>
<% end %>
ACTION
def query_results
@conditions = conditionalize(params[:query])
@users = User.find(:all, :conditions => @conditions)
respond_to { |format| format.js }
end
QUERY_RESULTS.JS.RJS
page.replace_html("query_results", :partial => "query_results")
--
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
-~----------~----~----~----~------~----~------~--~---