Giter Site home page Giter Site logo

palidanx / fullcalendar-rails-engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinsol/fullcalendar-rails-engine

0.0 2.0 0.0 723 KB

Rails engine implementation of fullcalendar jQuery plugin(http://arshaw.com/fullcalendar/). Create, edit, delete, reschedule, resize events like google calendar.

Home Page: http://vinsol.com/fullcalendar-demo

License: MIT License

fullcalendar-rails-engine's Introduction

#FullcalendarEngine

This engine supports only Rails 4 apps.

Installation

Add fullcalendar_engine to your Gemfile:

gem 'fullcalendar_engine'

Bundle install your dependencies and run the installation generator:

bundle install
bundle exec rails g fullcalendar_engine:install

Declare routes

mount FullcalendarEngine::Engine => "/fullcalendar_engine"

Create Single Event

FullcalendarEngine::Event.create({ 
    :title => 'title', 
    :description => 'description', 
    :starttime => Time.current, 
    :endtime => Time.current + 10.minute
})

Create Event Series

FullcalendarEngine::EventSeries.create({ 
    :title => 'title', 
    :description => 'description', 
    :starttime => Time.current,
    :endtime => Time.current + 10.minute, 
    :period => 'daily', 
    :frequency => '4'
})

In the config directory add the fullcalendar.yml and add mount_path option in it. Please note that this option is REQUIRED and if it is not specified then the JS and CSS of the engine would not work as desired..

mount_path: "<path you have mounted your engine on>"

The engine can have its own layout, you can add layout option to the configuration file. Besides this, all the options which are available with the fullcalendar.js are listed in the fullcalendar.yml.dummy file.

Using the Engine in some other views

Initially the engine is designed to work only on the mount point but you can now use this engine anywhere in your app but there is an HTML structure which this engine expects.

  • Create a link or button for the creation of the new events. On its click a modal popup would appear. You can bind the dialog form generation as follows. Assign it any class or id you want.
  $('<your-selector>').click(function(event) {
    FullcalendarEngine.Form.display()
    event.preventDefault();
  });
  • For the calendar events the following HTML code must be copied and pasted directly into your view.
  <div>
    <div class="calendar"></div>
  </div>
  <div id = "create_event_dialog" class="dialog" style ="display:none;"></div>
  <div id = "event_desc_dialog" class="dialog" style ="display:none;"></div>
  
  <script type = 'javascript'>
    $('.calendar').fullCalendar(full_calendar_options);
  </script>
  • The create_event_dialog is the container for the dialog form.
  • The event_desc_dialog is the container for the display of the details of the event.

Credits

vinsol.com: Ruby on Rails, iOS and Android developers

Copyright (c) 2014 vinsol.com, released under the New MIT License

fullcalendar-rails-engine's People

Contributors

bansalakhil avatar mohitwestagile avatar

Watchers

Dan Quach avatar James Cloos avatar

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.