Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rdiazv/rails_calendar
An easy to use calendar for your rails app
https://github.com/rdiazv/rails_calendar
Last synced: about 2 months ago
JSON representation
An easy to use calendar for your rails app
- Host: GitHub
- URL: https://github.com/rdiazv/rails_calendar
- Owner: rdiazv
- License: mit
- Created: 2014-08-31T06:13:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-01T21:26:09.000Z (over 10 years ago)
- Last Synced: 2024-04-24T14:30:01.072Z (9 months ago)
- Language: Ruby
- Size: 230 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# RailsCalendar
[![Gem Version](https://badge.fury.io/rb/rails-calendar.svg)](http://badge.fury.io/rb/rails-calendar)
[![Coverage Status](https://coveralls.io/repos/rdiazv/rails_calendar/badge.png?branch=master)](https://coveralls.io/r/rdiazv/rails_calendar?branch=master)
[![Build Status](https://travis-ci.org/rdiazv/rails_calendar.svg?branch=master)](https://travis-ci.org/rdiazv/rails_calendar)An easy to use calendar for your rails app.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rails-calendar'
```And then execute:
```
$ bundle
```Or install it yourself as:
```
$ gem install rails-calendar
```## Usage
Use the provided helper to render the calendar in your view:
```erb
<%= rails_calendar %>
```By default the calendar will show the current month, but can be easily
changed passing a Date object to the helper. For example, to render the
calendar for March 2000:```erb
<%= rails_calendar(Date.new(2000, 3)) %>
```Additionally, you can specify a block that will be invoked for each day to
show custom information in any calendar cell:```erb
<%
events = {
'2014-03-01' => [ 'TODO 1', 'TODO 2' ],
'2014-03-03' => [ 'TODO 3' ]
}
%><%= rails_calendar(Date.new(2014, 3)) do |date| %>
<% if events[date.to_s].present? %>
- <%= event %>
<% events[date.to_s].each do |event| %>
<% end %>
<% end %>
<% end %>
```
## Contributing
1. Fork it ( https://github.com/rdiazv/rails_calendar/fork )
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 a new Pull Request