Open manuelmeurer opened 10 years ago
For the moment, yes - the idea being you're typically generating links internal to the API.
It might make sense to make it be smarter about generating them only for api routes (which it doesn't at the moment) but that would take a bit more work.
Is it done here? https://github.com/Sutto/rocket_pants/blob/master/lib/rocket_pants/controller/url_for.rb What is this used for?
It's used so that when we generate links in the api to other API endpoints, it automatically includes the version the current user has specified, so they're consistent in linking.
Ah ok, makes sense. But is this the moment where the version
parameter is added to non-API URLs as well? Could we not check there if the URLs is for the API, and only add the parameter if it is?
@manuelmeurer I know this is an old task, but how did you get RP to render RABL files? I found another post, but it's not very elegant. Thanks!
@toobulkeh This is pretty much all it needs: https://gist.github.com/manuelmeurer/27cb13fb7bdbba49706a
very similar. Thanks!
I'm using RocketPants with Rabl. When I render a URL in a Rabl template, the
version
parameter is always added by default:When I add
version: nil
to the URL helper call, it disappears:Is this intended behavior?