vinsol / fullcalendar-rails-engine

Rails engine implementation of fullcalendar jQuery plugin(http://arshaw.com/fullcalendar/). Create, edit, delete, reschedule, resize events like google calendar.
http://vinsol.com/fullcalendar-demo
MIT License
66 stars 51 forks source link

events are saved, but not displayed. #7

Closed shivakumaarmgs closed 10 years ago

shivakumaarmgs commented 10 years ago

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
aditya-kapoor commented 10 years ago

Hi @shivakumaarmgs, I tried to replicate your issue but was unable to do. Please report back if you are still facing the issue.

shivakumaarmgs commented 10 years ago

Hi @aditya-kapoor, Still the issue exists. I have created a sample app which have the same issue and the link to that app is https://github.com/shivakumaarmgs/calendar-engine.

aditya-kapoor commented 10 years ago

Hi @shivakumaarmgs, I have cloned your application and ran. Looks like there is an issue with the cache. Please add the fullcalendar.yml and clear out the cache directory in the tmp directory and then try out.

shivakumaarmgs commented 10 years ago

Thanks a lot @aditya-kapoor. It works fine now.

mjuneja commented 10 years ago

Good to know that it works for you now Shiva.

Thanks for your help aditya

best,

Manik

On Tue, May 6, 2014 at 12:30 AM, Shivakumaar Mgs notifications@github.comwrote:

Thanks a lot @aditya-kapoor https://github.com/aditya-kapoor. It works fine now.

— Reply to this email directly or view it on GitHubhttps://github.com/vinsol/fullcalendar-rails-engine/issues/7#issuecomment-42224513 .

tomatoturnip commented 9 years ago

I ran the Rake command: rake tmp:clear Finally worked for me.