I have next file with jquery function:

**assets/ javascripts/poll\_items.js**

```
$(document).ready(function(){
    $('.up_id').on('click', function() {
    $(this).closest('.poll_row').insertAfter($(this).closest('.poll_row').next());
  });
  $('.down_id').on('click', function() {
    $(this).closest('.poll_row').insertBefore($(this).closest('.poll_row').prev());
  });
});

```

when i click `**= button\_tag 'up', type: 'button', value: 'up', input\_html: {class: 'up\_id'}'** nothing happens. How me correct call code from file javascript?

full code: 

**polls/new.html.haml**

```
%h1= title "Новый опрос"
= simple_form_for @poll do |f|
  = f.error_messages header_message: nil
  = f.input :question, disabled: !@poll.editable?(current_user), input_html: { class: 'input-block-level' }
  = f.input :results_hidden, as: :boolean, inline_label: 'Скрыть результаты до окончания опроса', label: false
  = f.input :from_date, as: :datetime, input_html: { class: 'poll_date' }
  = f.input :to_date, as: :datetime, input_html: { class: 'poll_date' }
  %h3#poll-items Варианты ответа (не больше пяти)
  .item_index  
    = f.simple_fields_for :poll_items do |poll|
      = render 'poll_item_fields', f: poll
    = link_to_add_association 'Добавить еще вариант', f, :poll_items
    .form-actions
      = f.button :submit, 'Опубликовать опрос', class: 'btn-bg'
      %p 
        Вернуться к посту:
        = link_to @owner

```

**poll\_fields.html.haml**

```
%h3#poll-items Варианты ответа (не больше пяти)
.item_index  
  = f.fields_for :poll_items do |poll|
    = render "poll_item_fields", f: poll
  .links
    = link_to_add_association 'Добавить еще вариант', f, :poll_items, render_options: {class: 'links'}

```

**poll\_item\_fields.html.haml**

```
.poll_row
  .poll_item
    = f.input :answer, input_html: { class: 'ctrlenter expanding' }, label: false, placeholder: 'Введите вариант ответа'
    = button_tag 'up', type: 'button', class: 'up_id', value: 'up'
    = button_tag 'down', type: 'button', class: 'down_id', value: 'down'
    = link_to_remove_association "удалить", f, { wrapper_class: 'poll_item' } 

```