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

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -