DRY up js.erb files (include another js.erb file)

前端 未结 2 393
慢半拍i
慢半拍i 2021-02-06 04:51

Most of my js.erb files contains something like this at the bottom:

$(\"#flash_message\").html(\"<%= escape_javascript(content_tag(:p, flash[:note], :class =&         


        
2条回答
  •  不知归路
    2021-02-06 05:37

    <%= render :partial => 'common' %>, perhaps?

    http://api.rubyonrails.org/classes/ActionController/Base.html#M000633

提交回复
热议问题