Rails draper gem with Ajax/JS -


i'm using draper , want use 1 of decorators in view.

with html works, decorators don't work in ajax version - undefined method error.

in commentdecorator:

delegate_all

def comment_author   "#{user.firstname} #{user.lastname}" end 

in view:

comment.comment_author 

i'm using exposure, don't need instance variables in views.

you can use comment.decorate.comment_author


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -