Can you use a Rails Engine with a JS Framework like Vue

279 Views Asked by At

I want to do a project with https://github.com/projectblacklight/blacklight Can I use it as a Rails API with a Vue frontend?

It is a Rails Engine that returns JSON but it is traditionally used in a Rails app as a Plugin / Gem (really it's an engine which is similar).

https://github.com/projectblacklight/blacklight/wiki Every Blacklight search provides JSON, RSS, and Atom Responses of search results

2

There are 2 best solutions below

0
jendiamond On

I am researching this and so far I think the answer is yes. Jason Coyne from Stanford built an App using Ember with Blacklight

Here are some more discussions around the question. + https://github.com/projectblacklight/blacklight/wiki/JSON-API + https://github.com/projectblacklight/blacklight/pull/588 + https://groups.google.com/forum/#!topic/blacklight-development/TIYCjemfp3A

There is not a lot of documentation about this that I can find.

0
cdmo On

blacklight-vue is an engine made explicitly for this purpose. blacklight-vue-demo is a sample build with this engine. The generic answer for building any Ruby on Rails application with Vue is to use the Webpacker gem.