Reputation: 793
I was getting a little tired of seeing this sort of thing:
$('#events').load('/user/' + user.id + '/events?limit=' + limit);
Strewn throughout my code when I had nice rails routes like user_events_path(user)
to use.
Upvotes: 1
Views: 37
Reputation: 793
It turns out there's a nice plugin called js-routes that allows you to reuse your routes like this:
Routes.user_events_path({user_id: user.id})
Upvotes: 1