What would the below js.erb template look like when rewritten into slim?
$('#new_reservation').hide().after('<%= j render("new_reservation") %>');
| $('#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);
来源:https://stackoverflow.com/questions/27158328/rewrite-template-js-erb-into-template-js-slim