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 - How to update a get parameter in a url with jquery -

amazon web services - How to determine the state of an AWS instance -

bitmap - Android load image into imageview efficiently -