ElMassimo / js_from_routes

🛣️ Generate path helpers and API methods from your Rails routes
https://js-from-routes.netlify.app/
MIT License
100 stars 7 forks source link

fix: use relative paths in auto-generated files #36

Closed ElMassimo closed 1 year ago

ElMassimo commented 1 year ago

Description 📖

This pull request fixes #35 and similar bugs by defining import_filename in terms of the location of the index file.

Background 📜

This was happening because import_filename was assuming a specific dir structure.

The Fix 🔨

Using relative paths, allowing the generated code to be valid when a different output_folder is provided.