Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `xeditable?' error shows up #90

Open
ghost opened this issue Aug 1, 2017 · 1 comment
Open

undefined method `xeditable?' error shows up #90

ghost opened this issue Aug 1, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 1, 2017

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
@Br3nda
Copy link

Br3nda commented Sep 24, 2019

One edit:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant