about summary refs log tree commit diff stats
path: root/app/controllers
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-07-07 17:20:08 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-07-07 17:20:08 -0400
commit5be9480128b2841647b204ba19ec9f45dac438f5 (patch)
treeb83441962e485e70d239a3ad8b9bf6ae6d9d5db6 /app/controllers
parenta4779bdb3baf50b477bbe166f7b1d873d75e506f (diff)
downloadthoughts-5be9480128b2841647b204ba19ec9f45dac438f5.tar.gz
thoughts-5be9480128b2841647b204ba19ec9f45dac438f5.tar.bz2
thoughts-5be9480128b2841647b204ba19ec9f45dac438f5.zip
Added tag autocompletion
refs #2
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/tags_controller.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb new file mode 100644 index 0000000..7115d28 --- /dev/null +++ b/app/controllers/tags_controller.rb
@@ -0,0 +1,11 @@
1class TagsController < ApplicationController
2
3 def suggest
4 @tags = ActsAsTaggableOn::Tag.pluck(:name).select do |tag|
5 tag.starts_with? params[:term]
6 end
7
8 render json: @tags
9 end
10
11end