One way:
javascript_tag do == "var all_product_ids = #{existing_ids.to_json};" == "var products_json = #{@filter.data.to_json};"
or:
= %Q{ var all_product_ids = #{existing_ids.to_json}; var products_json = #{@filter.data.to_json}; }
are there any better solutions for this?
Definition of slim file : a file very narrow in proportion to its length.
What is Slim? Slim is a fast, lightweight templating engine with support for Rails 3 and later. It has been heavily tested on all major ruby implementations. We use continuous integration (travis-ci).
Slim is an ultra fast, native and elegant library for Web Components development.
Slim is a page-templating language that minimizes markup and syntax. It removes most of the extra "programming-like" symbols from HTML so that your code looks cleaner. Slim also adds if-else statements, loops, includes, and more.
In Slim
javascript: var all_product_ids = "#{existing_ids.to_json}"; var products_json = "#{@filter.data.to_json}";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With