add tags autocomplete
This commit is contained in:
parent
6323cdda68
commit
1e5aa0efff
6 changed files with 63 additions and 0 deletions
|
@ -57,9 +57,19 @@
|
|||
$(function(){
|
||||
var tag_field = $('#tag_field').tagify();
|
||||
|
||||
|
||||
tag_field.tagify('inputField').autocomplete({
|
||||
source: '/tags/autocomplete.json',
|
||||
position: { of: tag_field.tagify('containerDiv') },
|
||||
close: function(event, ui) { tag_field.tagify('add'); },
|
||||
});
|
||||
|
||||
|
||||
$('form').submit( function() {
|
||||
var tag_field = $('#tag_field')
|
||||
tag_field.val( tag_field.tagify('serialize') );
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
|
2
app/views/tags/autocomplete.html.haml
Normal file
2
app/views/tags/autocomplete.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
%h1 Tags#autocomplete
|
||||
%p Find me in app/views/tags/autocomplete.html.haml
|
2
app/views/tags/index.html.haml
Normal file
2
app/views/tags/index.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
%h1 Tags#index
|
||||
%p Find me in app/views/tags/index.html.haml
|
Loading…
Add table
Add a link
Reference in a new issue