Question

I need to implement a booking system for a pre-existing model in a Rails app. I've only found one relevant gem (called "Bookable") but it seems a bit unripe at this point to rely on, and I would love to see it get battle-tested a bit more.

It would also be better if I could avoid installing RefineryCMS and its accompanying booking capabilities, as that seems to be a very heavy-handed approach and I want to retain my existing front-end feel as much as possible.

So my question is does anyone have experience implementing a Rails (4) User booking system from back-to-front in Rails and how have you done it? I would like for the front-end to be simple, jQuery calendar type stuff (let's assume I'm booking on timescales of 15 minutes to 6 hours).

For the back-end how would I implement bookings on a pre-existing model where multiple Users could have potential access? After some preliminary research I'm thinking a combination of StateMachine and EventMachine would do the trick, but I'm really coming from a mile-high perspective right now and would need to start filling in all the gaps and details.

Was it helpful?

Solution

I don't think a generic solution exists and I wouldn't use some obsolete Refinery's engine as well. It's even less likely that you will find something useful that would easily integrate with your current app.

Eventmachine can't be run inside rails, it has to run as a separate process and would present unnecessary overhead for a simple Booking system.

StateMachine is just a system's building block. When you'll have a table e.g. 'reservations' then you'll use state machine to navigate through a life cycle of a particular reservation.

I don't see it as something very exotic, seems that you will have to create one yourself as you would for any other rails app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top