diff --git a/app/controllers/fullcalendar_engine/events_controller.rb b/app/controllers/fullcalendar_engine/events_controller.rb index 80dd322..897adc7 100644 --- a/app/controllers/fullcalendar_engine/events_controller.rb +++ b/app/controllers/fullcalendar_engine/events_controller.rb @@ -22,7 +22,7 @@ def new end end - def index + def get_events start_time = Time.at(params[:start].to_i).to_formatted_s(:db) end_time = Time.at(params[:end].to_i).to_formatted_s(:db) diff --git a/config/initializers/configuration.rb b/config/initializers/configuration.rb index 990c4fe..70db4d8 100644 --- a/config/initializers/configuration.rb +++ b/config/initializers/configuration.rb @@ -15,4 +15,4 @@ 'timeFormat' => "h:mm t{ - h:mm t}" } FullcalendarEngine::Configuration.merge!(config) -FullcalendarEngine::Configuration['events'] = "#{FullcalendarEngine::Configuration['mount_path']}/events" +FullcalendarEngine::Configuration['events'] = "#{FullcalendarEngine::Configuration['mount_path']}/events/get_events" diff --git a/config/routes.rb b/config/routes.rb index 56314f8..003665f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,8 @@ FullcalendarEngine::Engine.routes.draw do - resources :events do + resources :events do + collection do + get :get_events + end member do post :move post :resize