views:

38

answers:

1

I have a method I want to call using AJAX in rails but I have no idea how to do so. The method is private and has no view. Right now all it SHOULD do is replace a div tags html to show a flash[:notice].

+4  A: 

You can't call a private method via AJAX. All ajax does is make an HTTP request just like visiting a page in the browser, only asynchronously. You need to make the method into a controller action.

BJ Clark