[Facebooker-talk] Trouble with link_to_remote in Facebooker

Bryan bdondo at gmail.com
Mon Aug 11 13:03:31 EDT 2008


David Clements helped a ton by pointing out that I didn't have the
protect_from_forgery call in my application controller.  Everything works
great now...

Thanks Dave!

Bryan


On Mon, Aug 11, 2008 at 8:56 AM, Bryan <bdondo at gmail.com> wrote:

> 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/335fc66e/attachment.html>


More information about the Facebooker-talk mailing list