Topic: How to call a helper function from jQuery?

I have a helper function which accepts a table_name parameter and outputs html.  How (and from where) do I call that Rails function from Javascript (or jQuery)?

Can I call it from jQuery's document.ready?
Or, do I need a .js.erb partial?
Or, am I missing something else completely?


The helper function is a custom helper function, I defined in a module in app/helpers
(Rails 3 app).

My goal, is to list several table names with spinners after them.  Then,
after document.ready fire off AJAX calls to replace the spinners with a
count of all of the records in each table listed.

So, something like this:

Customer Orders *

becomes this:

Customer Orders (125)

If you imagine the asterisk is a spinner.

Last edited by ejstembler (2011-04-05 11:10:32)