GithubHelp home page GithubHelp logo

bookable's Introduction

Bookable

Gem Version

Bookable is a Rails 4.0 gem that enables you to add resource booking functionality to your Rails application. A resource can be anything that is bookable e.g. tennis court, football pitch, bowling lane, function room, conference room, office space.

Installation

Bookable works with Rails 4.0. Add this line to your application's Gemfile:

gem 'bookable', '~> 0.0.52'

Then execute:

$ bundle

Or install it yourself as:

$ gem install bookable

After you've installed the gem, you need to run the generator:

$ rails generate bookable:install

Alternatively you can specify a named resource by providing an argument to the rails generate command e.g.

$ rails generate bookable:install tennis_court

The generator will create the file structure you need to implement booking functionality into your app:

  • controllers
  • models - resource(tennis_court) and booking
  • views
  • javascript - which uses the jquery fullcalendar plugin
  • css - some basic css is provided which you may want to override
The necessary routes will be applied to your routes file and you will need to run
$ rake db:migrate

Validations

Validations have been created for the models to ensure that a bookable resource is created with a unique name and bookings are created in the future and resources are not double booked. For further information, refer to the tests and for an example of how the gem is used, visit this site.

Known Bugs

  • Front end Date validation, for example 30th February is not a valid date but is permitted by the calendar view.
  • Implement server side date validation for above - currently if a booking for 30th February is entered, the booking will be created for 2nd March.

Contributing

There are a number of desired features we hope to implement in the future. If you wish to contribute please do so in the following manner.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Desired Features

  • optional description attribute for booking and resource models
  • implement show route for bookings
  • provide fix for Known Bugs

Contributors

License

Bookable is released under the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.