Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% @y = [] %>
- <% User.all.each do |user| %>
- <% x = user.username %><br>
- <% if x %>
- <% @y << "@" + x %>
- <% end %>
- <% end %>
- <% @y %>
- <script>
- $( function() {
- var availableTags = <%= raw @y %>;
- var inputTag = document.getElementById('tags');
- var textValue = inputTag.value;
- var at = document.getElementById("tags").value.indexOf("@");
- if (at == 1) {
- $( "#tags" ).autocomplete({
- source: availableTags
- });
- }
- } );
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement