[Facebooker-talk] Trouble with link_to_remote in Facebooker

Bryan bdondo at gmail.com
Mon Aug 11 11:56:23 EDT 2008


Hi, I'm trying to update a div with ajax using link_to_remote, but can't
seem to get it working.  I can get form_remote_tag to work just fine though.


My InfoController (it's not a RESTful controller) simply has:

  def update_ajax
    render :text => 'new text'
  end

And my view has:

<p>Ajax test - link_to_remote</p>
<%=link_to_remote('update it',
  :update => 'foo',
  :url => info_ajax_update_url(:canvas => false)
) %>
<br/>

<p>Ajax test 2 - form_remote_tag </p>
<% form_remote_tag  :url => info_ajax_update_url(:canvas=>false),
:update=>"foo" do |f|%>
<%= submit_tag 'Update' %>
<% end %>

<div id='foo'>
  Original text
</div

In my routes I have:

map.info_ajax_update 'info/update_ajax', :controller => 'info', :action =>
'update_ajax'

(if the above looks garbled, I've put it up on pastie as well:
http://pastie.textmate.org/250092 )

Firebug gives me this error: a5279184xxx_options[idx("parameters")] is
undefined

Any ideas?  Anyone have an example of working link_to_remote usage?  I
searched this mailing list but didn't find anything that works for me.

Thanks,
Bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080811/3105590e/attachment.html>


More information about the Facebooker-talk mailing list