I'm new to rails, I am reading through the documentation and trying to figure-out how can i enhance existing gem
so i can add few end points which can be consumed from the client applications (angular apps, vue apps, react apps).
Example:
I have existing gem called book_scheduler
. looking at this it doesn't have app
or config
folder structure but bin
and lib
.
Now i would like to enhance the gem to have two endpoints, so the clients can call book/count
and book/return
using fetch
.
How can i accomplish this ? Can i somehow enhance the gem to have rails engine and define routes ? Any advice or guidance is much appreciated.
If you wan to use book_scheduler
in many rails application, you can make it an Engine
It will help you to cerate many rails application with the same endpoints
But if you want to build a single rails API (used by multiple client apps), you should do the following :