views:

21

answers:

1

I have this

<%= link_to_remote "Next", 
    {:url => { :controller=>:objects,
        :action=>:filter_recent,
        :page=>@objects.next_page},
        :with => "Form.serialize('filter')" }, 
    :after => "alert('hello')"%>

I've tried :before, :after, :loading, :complete... none of them appear to be working... I know the button works, cause the table advances to the next page.

A: 

It looks like your arguments are incorrectly split up by the hash you wrapped them in.

Your :after JS snippet/callback is being passed to the html_options argument hash, not the options hash (where it would be used).

Change to the following:

<%= link_to_remote "Next", 
    :url => { 
        :controller=>:objects,
        :action=>:filter_recent,
        :page=>@objects.next_page
    },
    :with => "Form.serialize('filter')",
    :after => "alert('hello')"%>
Winfield
you, sir, are my new best friend. (but only for the next 5 minutes while I make all these changes) =p
DerNalia