How to pass params into partial with haml and unobtrusive javascript
comments/create.js.haml
$("#comment_list").html("#{escape_javascript( render(:partial => "shared/comments", :locals => { :commentable => @album }) ).html_safe}");
cra开发者_Go百科shed
but in albums/show.html.haml
#comment_list= render :partial => 'shared/comments', :locals => { :commentable => @album }
working without bugs
I'm change
#comment_list= render :partial => 'shared/comments', :locals => { :commentable => @album }
to
#comment_list= render :partial => 'shared/comments', :locals => { :commentable => @commentable }
and install Haml v3.1.2
精彩评论