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

Mounting engine bug? #15

Closed ehannes closed 9 years ago

ehannes commented 9 years ago

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?

aditya-kapoor commented 9 years ago

Hi @ehannes I tried to reproduce the bug but I wasn't able to. Make sure you set the mount_path variable in the fullcale dar.yml is same as the mount path. Clear out any caches and try again. It should work as expected.

ehannes commented 9 years ago

Thank you for looking into it! I'm sorry to say, but I cannot reproduce it any more either. I don't know what made it work, but now I can choose mount point.

ehannes commented 9 years ago

I know now what the problem was. When editing the fullcalendar.yml, you need to restart the rails server (at least I had to).