1

I'm trying to get a set of VueJS components i.e. VueStrap, installed in a Rails project. VueJS is setup and working correctly.

Typically I would use npm to install VueStrap if I was doing this outside of a Rails project.

How can I install VueStrap in a rails project?

3
  • 1
    You should still be able to use npm, though I think yarn is preferred with rails, just try running yarn add vue-strap from your project root. (add -D flag to save to dev-dependencies) Commented Nov 28, 2017 at 17:50
  • Thanks! I ran that, how can test it to see if it works? I have a simple hello world vue template which is working fine. How can I include vue-strap into the project and show a button for example? Commented Nov 29, 2017 at 13:15
  • 1
    Hope you this will help you vuejs installation doubts stackoverflow.com/questions/47574225/… Commented Nov 30, 2017 at 13:08

3 Answers 3

2

You should take a look at the webpacker gem. You can then use webpack + yarn very easily with Rails.

Sign up to request clarification or add additional context in comments.

Comments

2

If you don't want to go by any of these routes mentioned above, you can always set up the frontend as a separate entity.

You can set up CORS using rack-cors gem, and use it to communicate with VueJS frontend.

That way Rails doesn't have to be concerned about the specific webpack/yarn/gulp, or whatever setup you have for your frontend logic.

Comments

0

Hope you this will help you vuejs with webpacker gem installation doubts

**Steps to install Vuejs via webpack in rails app**

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.