brendon / acts_as_list

An ActiveRecord plugin for managing lists.
http://brendon.github.io/acts_as_list/
MIT License
2.05k stars 356 forks source link

undefined local variable or method `list_item' #167

Closed obelich closed 9 years ago

obelich commented 9 years ago

Hiyas i recent try to install the gem in my proyect but it give that error i have this in the model

class Galeria < ActiveRecord::Base
  acts_as_list
  has_many :imagenes, :as=> :imageable, dependent: :destroy
  accepts_nested_attributes_for :imagenes,  :reject_if => lambda { |attrs| attrs.all? { |key, value| value.blank? }}
end

and this in the view

    <% @galerias.each do |galeria| %>
      <tr>
        <td><%= list_item.increment_position %></td>
        <td><%= galeria.nombre %></td>
        <td>

          <%= link_to '<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>'.html_safe, galeria %>

        </td>
      </tr>
    <% end %>

but it give that error :(

Albin-Willman commented 9 years ago

Is this really related to this gem? Isn´t it just that you are using list_item which does not seem to be a variable or helper method. I think it is very unclear what you are trying to do. But I think it is more of a question for stack overflow than a github issue.

Imho this issue should be closed.

brendon commented 9 years ago

I agree. I'll close it for now. @obelich, comment if you want to add some more information specific to acts_as_list so that we can debug.

obelich commented 9 years ago

is ok jejeje :)