Class: TagsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- TagsController
- Defined in:
- app/controllers/tags_controller.rb
Constant Summary
Constants inherited from ApplicationController
ApplicationController::ALLOWABLE_CONFIGS
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/tags_controller.rb', line 4 def index respond_to do |format| format.json do = begin if params[:search] ActsAsTaggableOn::Tag.distinct.where('name LIKE ?', "%#{params[:search]}%").pluck(:name) else ActsAsTaggableOn::Tag.distinct.pluck(:name) end end render json: end end end |