mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-22 16:56:10 +01:00
use twitter/typeahead for autocomplete. make go to project|context|tag work and show
project details in a popover
This commit is contained in:
parent
31386db3df
commit
c0edd1749c
19 changed files with 1924 additions and 187 deletions
|
|
@ -685,12 +685,13 @@ class TodosController < ApplicationController
|
|||
|
||||
def tags
|
||||
# TODO: limit to current_user
|
||||
tags_beginning = Tag.where('name like ?', params[:term]+'%')
|
||||
tags_all = Tag.where('name like ?', '%'+params[:term]+'%')
|
||||
term = params[:query] || param[:term]
|
||||
tags_beginning = Tag.where('name like ?', term+'%')
|
||||
tags_all = Tag.where('name like ?', '%'+term+'%')
|
||||
tags_all= tags_all - tags_beginning
|
||||
|
||||
respond_to do |format|
|
||||
format.autocomplete { render :text => for_autocomplete(tags_beginning+tags_all, params[:term]) }
|
||||
format.autocomplete { render :text => for_autocomplete(tags_beginning+tags_all, term) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue