Rewrite template.js.erb into template.js.slim

心已入冬 提交于 2019-12-01 18:27:00
| $('#new_reservation').hide().after('
= j render("new_reservation")
| ');

you can check this gem for further simple conversions

lately I bumped into same problem

| $('#new_reservation').hide().after('#{= j render("new_reservation")}');

maybe for someone will be helpful Rails 4.2 Ruby 2.3

Slim provides a multiline approach:

|
  var html = "#{ j render("new_reservation") }";
  $('#new_reservation').hide().after(html);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!