Reputation: 134
Current state
I have a website fully developed in Rails, using Rails views, classic Coffescript and SCSS. All my routes are declared on routes.rb.
What it's needed
Some of the pages developed have a lot of logic associated with, and it makes more sense to migrate it to a web app. The chosen web app was Vue.js.
The whole website (a very complex product) will be incrementally deployed (when the page using Vue.js is ready, the page on the Rails app should be 'replaced' by the new one). A major constraint is that the codebase is different. The Vue.js app will get information from the Rails app API.
Problems (help needed)
How can I set that some routes goes to the Rails app, and others go to the Vue.js app? (remember that are different codebases, different 'physical folders')
Thanks in advance.
Upvotes: 1
Views: 1569
Reputation: 2694
Have you checked out the webpacker project?
If your vue project is already in single vue components, then you can import the component into rails projects.
To get started, please follow the readme of webpacker.
At your rails' view.
<%= javascript_pack_tag 'components/vue' %>
This way, you can continue to use rails' route.
Upvotes: 2