I have a simple ruby on rails project that I'm trying to use a simple jquery post with and, well I'm stuck. I think I'm expected this to work like ASP.NET MVC and it aint.
Here is what I have in the controller
def followers(username)
return username
end
And in my .erb file I have the call to the method
$.post("home/followers", { username: $("#txtUsername").val() },
function(data) {
alert(data);
});
And what I get back is an error telling me: wrong number of arguments (0 for 1)
So I tried appending the parameter to the query string like...
$.post("home/followers?username=burkeholland",
function(data) {
alert(data);
});
This should be easy points for somebody. And would you believe I couldn't find anything about this via Google? There is a dirth of Ruby on Rails examples available online. Or maybe I'm just spoiled from ASP.NET.