Coder Social home page Coder Social logo

vinsol / fullcalendar-rails-engine Goto Github PK

View Code? Open in Web Editor NEW
66.0 66.0 51.0 241 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

Ruby 7.81% JavaScript 80.43% CSS 6.24% HTML 5.52%

fullcalendar-rails-engine's People

Contributors

bansalakhil avatar kuldeepaggarwal avatar mohitwestagile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fullcalendar-rails-engine's Issues

get_events api not returning events

get_events action isn't correctly parsing start_time and end_time.

The code is currently as following

def get_events
    start_time = Time.at(params[:start].to_i).to_formatted_s(:db) #=> "1970-01-01 09:33:34"
    end_time   = Time.at(params[:end].to_i).to_formatted_s(:db) #=> "1970-01-01 09:33:34"

(This is because "2014-08-31".to_i returns 2014.)

but should be

def get_events
    start_time = Time.parse(params[:start]).to_formatted_s(:db)
    end_time = Time.parse(params[:end]).to_formatted_s(:db)

My environment was as following.
rails version: 4.0.0
ruby version: ruby 2.0.0p353

Unwanted CSS

Can you somehow choose not to use the included style.css, without forking this repository and remove it? This file has rules that I do not want in my application, for example rules for body and h1 tags.

Mounting engine bug?

When mounting the fullcalendar_engine, I first used mount FullcalendarEngine::Engine => "/fullcalendar_engine" as suggested on the readme for the engine.
When trying to get /fullcalendar_engine path I got following problem: ( ~ is the path to my home folder).

  ActionController::RoutingError (No route matches [GET] "/calendar/events/get_events"):
  actionpack (4.1.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.5) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.5) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.5) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.5) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.5) lib/rails/engine.rb:514:in `call'
  railties (4.1.5) lib/rails/application.rb:144:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
  ~/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  ~/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  ~/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'


  Rendered ~/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (0.8ms)
  Rendered ~/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb (5.3ms)

I downloaded the sample application and saw that the mount was mount FullcalendarEngine::Engine => "/calendar". I changed my mount point to the same and it worked perfectly. To me it appears that the path must be /calendar is hard coded. Am i right or have I missed something?

Long events

It doesn't show long events, for example try create event with dates: 2014.06.28 - 2014.07.27

Issue when deploying to Heroku through codeship.com

I'm getting the following error in their build console when I release to Heroku through codeship.com

remote: You have added to the Gemfile:�
remote: * fullcalendar_engine�
remote: !�
remote: ! Failed to install gems via Bundler.�

.. If i can provide anymore info, please let me know

Changing color of events

Is it possible to different colors for different events? I know [http://fullcalendar.io/docs/event_data/Event_Source_Object/#options](fullcalendar supports it), but does this rails engine support it too?

Routes issue when mounting engine in existing app

mount FullcalendarEngine::Engine => "/fullcalendar_engine"

I have an existing app, with Devise, RailsAdmin etc, I installed the gem and mounted in routes.rb I then have broken routes for the rest of the app when I goto the full calendar mount point. I assume I need to inherit some of the routes from the rest of the app?

Testing

I think the current test coverage of this engine is about 0 %. It would be advisable to add at least some basic tests.

JQuery UI images cannot be found

When running in production environment and Rails 4, the server cannot find JQuery UI images.

I, [2015-09-10T15:37:04.710074 #6806]  INFO -- : Started GET "/assets/images/ui-bg_diagonals-thick_20_666666_40x40.png" for (ip address) at 2015-09-10 15:37:04 +0200
F, [2015-09-10T15:37:04.710927 #6806] FATAL -- : 
ActionController::RoutingError (No route matches [GET] "/assets/images/ui-bg_diagonals-thick_20_666666_40x40.png"):
  actionpack (4.1.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.5) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.5) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.5) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.5) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.1.5) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.5) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.5) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.5) lib/rails/engine.rb:514:in `call'
  railties (4.1.5) lib/rails/application.rb:144:in `call'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:94:in `process_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:149:in `accept_and_process_next_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:111:in `block in create_thread_and_abort_on_exception'

I see you have explicitly declared the image paths in fullcalendar_engine.gemspec with Gem::Specification.files. Is this compatible with Rails 4?

Did anyone get this working with will_paginate?

I am unable to get this working with will_paginate, as I explain here: mislav/will_paginate#172

I have the following in my routes.rb:

mount FullcalendarEngine::Engine , at: "/fullcalendar_engine"

resources :events,  module: 'fullcalendar_engine' , only: [:index, :show] do

 collection do
  get 'calendar', to: 'events#calendar', as: 'calendar'
    post :check
  end
end

But there is no way for me to generate the url:

FullcalendarEngine::Engine.routes.url_for({ controller: 'events', action: 'index'})
ActionController::UrlGenerationError: No route matches {:action=>"index", :controller=>"events"}

 RailsDevise::Application.routes.url_for({ controller: 'events', action: 'index'})
ActionController::UrlGenerationError: No route matches {:action=>"index", :controller=>"events"}

What can I do?

application.css conflict with application.css.scss

🌵
the bundler requires an application.css file to append to, my app uses an application.css.scss. In order to satisfy the bundler I created a blank application.css. I was able to complete the bundler, however the new application.css overrides the old application.css.scss. Is there a work around for needing the application.css in the bundler, or do you have a recommendation for stopping the new css file from overriding the old css.sccs?

Submit Buttons are not getting enabled

Whenever there is an error while creating a form then after receiving response from server, submit buttons are still disabled.

Proposed solution:

$(document).ajaxComplete(function () {
  setTimeout(function() {
    $('[name="commit"]').attr("disabled", false);
  }, 1000)
});

events are saved, but not displayed.

I have installed fullcalendar_engine in my application. The mount point for engine in route file is mount FullcalendarEngine::Engine => "/calendar". The calendar appears in localhost:3000/calendar path. But events are not displayed. I had also mentioned the mount point in config/fullcalendar.yml file mount_path: "/calendar", still no use.

The server logs while creating an event is as follows.

Started POST "/calendar/events" for 127.0.0.1 at 2014-05-04 20:30:33 +0530
Processing by FullcalendarEngine::EventsController#create as */*
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"E73nlTh2UdqyHGRxpzEVrIDJxnHD8bJex8AJtthP3+4=", "event"=>{"title"=>"boss", "description"=>"what", "starttime(1i)"=>"2014", "starttime(2i)"=>"5", "starttime(3i)"=>"4", "starttime(4i)"=>"00", "starttime(5i)"=>"00", "endtime(1i)"=>"2014", "endtime(2i)"=>"5", "endtime(3i)"=>"4", "endtime(4i)"=>"00", "endtime(5i)"=>"15", "all_day"=>"1", "period"=>"Does not repeat", "frequency"=>"1"}}
   (0.4ms)  BEGIN
  SQL (108.6ms)  INSERT INTO "fullcalendar_engine_events" ("all_day", "created_at", "description", "endtime", "starttime", "title", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"  [["all_day", "t"], ["created_at", "2014-05-04 15:00:33.776997"], ["description", "what"], ["endtime", "2014-05-04 00:15:00.000000"], ["starttime", "2014-05-04 00:00:00.000000"], ["title", "boss"], ["updated_at", "2014-05-04 15:00:33.776997"]]
   (52.0ms)  COMMIT
  Rendered text template (0.0ms)
Completed 200 OK in 362ms (Views: 9.7ms | ActiveRecord: 161.3ms)

The server logs after creating and event (ie when the engine fetches the json from get_events funtion)

Started GET "/events/get_events?start=1399141800&end=1399746600&_=1399215625062" for 127.0.0.1 at 2014-05-04 20:30:34 +0530

ActionController::RoutingError (No route matches [GET] "/events/get_events"):
  actionpack (4.1.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.1.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.0) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.0) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.0) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.0) lib/rails/rack/logger.rb:20:in `call'
  quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
  actionpack (4.1.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.0) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.1.0) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.0) lib/rails/engine.rb:514:in `call'
  railties (4.1.0) lib/rails/application.rb:144:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
  /home/shivakumaarmgs/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  /home/shivakumaarmgs/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  /home/shivakumaarmgs/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

The JSON data are not available in /events/get_events?start=1399141800&end=1399746600&_=1399215087828 path, i get No route matches [GET] "/events/get_events.json" error over there. Instead they are available on the /calendar/events/get_events?start=1231231..... path [{"id":4,"title":"boss","description":"what","start":"2014-05-04T00:00:00Z","end":"2014-05-04T00:15:00Z","allDay":true,"recurring":false}] as `/calendar' is the mount point of the engine in my application. Is there any work around to make it fetch from the correct path?

My ruby and rails versions are

ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
Rails 4.1.0

How customize the views

tanks for develop an awesome engine.....
I implement de fullcalendar engine with sucess, but i need customize the _form view because my default language it is another......how i can do this? its possible? i am starting with engines and i don't know much....

Create Event button not working

hi, i successfully mount the engine on "/timetrack" on my application.
when i visit that uri, i see the calender with a "create event" link on top. but when i click on it, nothing happens. checking the console in firebug, i see a 404 not found error as shown below:

GET http://localhost:3000/trackmate/events/new [HTTP/1.1 404 Not Found 42ms]

Error mounting route : mount FullcalendarEngine::Engine => "/fullcalendar_engine" fails

Hi, when i run the command mount FullcalendarEngine::Engine => "/fullcalendar_engine" on my ubuntu terminal i get the error "bash: /fullcalendar_engine: Permission denied ". i guess this is a problem with my system or so. i would appreciate if you can explain to me what exactly is happening here. any help will be appreciated.

Also, In the "Declare routes section on your doc", i think it will be better to specify what exactly one is suppose to put in between the quotes " ". i.e. whether to insert full application route or just a subpath to the installation of fullcalender_engine. thanks

fullcalendar.yml options not overriding defaults

Hi,

Not sure if this gem is still being maintained but figured I'd throw my issue out here. I am adding configs in fullcalendar.yml to override the defaults and some of them are not being overridden and I believe it is because they are being hard set again in app/assets/javascripts/fullcalendar_engine/fullcalendar.js in var defaults = {

This is the contents of my fullcalendar.yml:

mount_path: "/fullcalendar"
layout: 'custom'
height: 1000
defaultView: 'agendaWeek'
timeFormat: "h:mm a{ - h:mm a}"
allDayDefault: false

However, defaultView, timeFormat and allDayDefault are not being set property, they are set to what is in fullcalendar.js. Even configs in config/initializers/configuration.rb are being overridden by what's in fullcalendar.js.

Anyone know how I can get this to work? Thanks for any help!

relationship between user and event

First I have to say my English is poor so apologize if I didn't make myself clear.

I think that it's a great gem!
I wan't use it but I need some help about relationship.
How can I configure that for events belongs_to user?
Is it possible to do something like this...

mount FullcalendarEngine::Engine => "users/user_id/fullcalendar_engine"

and configure model and controller with this relationship?

How to set custom options in fullcalendar.yml

I'm trying to set custom options in the fullcalendar.yml. The mount and the layout functions are working, but when I try to set any of the fullcalendar options, like weekNumbers: true, or editable: false nothing happens.Am I missing something to get this working? I am using the fullcalendar engine demo app to try getting any of these functions to work.

/fullcalendar_engine: Permission denied

I ran mount FullcalendarEngine::Engine => "/fullcalendar_engine" and got "-bash: /fullcalendar_engine: Permission denied" I googled the error but couldn't find any helpful results. Any help? Thanks!

Use ActiveModel Serializer for json response.

In app/serializers/fullcalender_engine/event_serializer.rb

module FullcalendarEngine
  require 'active_model_serializers'
  class EventSerializer < ActiveModel::Serializer
    attributes :id, :title, :description, :start, :end, :allDay, :recurring

    def description
      object.description || ''
    end

    def start
      object.starttime.iso8601
    end

    def end
      object.endtime.iso8601
    end

    def allDay
      object.all_day
    end

    def recurring
      object.event_series_id?
    end
  end
end

In fullcalendar_engine.gemspec:

s.add_dependency "active_model_serializers", ">= 0.9.4"

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.