Am having real probs trying to use Ajax with my Rails app. I have set up
a test as
follows:
in javascript file:
window.onload = function() {
$('#test').bind('ajax:success', function() {
alert("success");
};
}
in view:
<%= link_to "test", { :action => :getDiagram }, :remote => true, :id =>
"test" %>
in controller:
def getDiagram
end
Now I know this looks odd with the empty controller action, but I would
expect this code to just show a popup window with 'success' and leave
the current page loaded when the link is clicked? Instead i get the
missing template message like its trying to load a page synchronously
rather than using ajax?
Can anyone get my test to work? Do I need to upgrade or add a gem file?
Thanks in advance
Jason
--
Posted via
http://www.ruby-forum.com/.