werein / x-editable-rails

Edit fields easily with X-Editable helper

Home Page:https://wereinhq.com/guides/x-editable-rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined method `xeditable?' error shows up

opened this issue · comments

I included this in _coment.html.erb

<%= editable [comment.article, comment], :content, url: edit_article_comment_path(comment.article, comment) %>

I also included a helper method below, which is included (helper_method :xeditable?) in the application controller. I don't use cancan authentication.

module ApplicationHelper

def xeditable?
  can?(:edit, object) ? true : false
end
  
  def can?(role, object)
     true 
  end
end

One edit:

  def xeditable?(object)
    can?(:edit, object) ? true : false
  end