开发者

rails 3 pass params into partial with haml and unobtrusive javascript

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜