diff options
| author | Xinhui | 2017-05-19 16:47:48 +0200 |
|---|---|---|
| committer | Xinhui | 2017-05-19 16:51:37 +0200 |
| commit | 96f12acb6a122c8549e00f04c953e51f5212a6cf (patch) | |
| tree | e54fe64ec467c2c5930db4aafe6917a14cbcbf4e /app/controllers/autocomplete_calendars_controller.rb | |
| parent | 4c1a2a33fde5b29f3b4c4024281ad80277a967d5 (diff) | |
| download | chouette-core-96f12acb6a122c8549e00f04c953e51f5212a6cf.tar.bz2 | |
Templating select2 time_table_combination + refactoring
Refs #3406
Diffstat (limited to 'app/controllers/autocomplete_calendars_controller.rb')
| -rw-r--r-- | app/controllers/autocomplete_calendars_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/autocomplete_calendars_controller.rb b/app/controllers/autocomplete_calendars_controller.rb new file mode 100644 index 000000000..dbdd1a9fc --- /dev/null +++ b/app/controllers/autocomplete_calendars_controller.rb @@ -0,0 +1,7 @@ +class AutocompleteCalendarsController < ApplicationController + respond_to :json, :only => [:autocomplete] + + def autocomplete + @calendars = Calendar.search(params[:q]).result.paginate(page: params[:page]) + end +end |
