I use HAML in my rails project for my html templates. I would like to figure out if its possible to divide a very long line and make it a couple of rows:
%a.open-service{href: '#', data: {
service_name: service.description,
balance_type: "coinsurance",
total: service.a_total_billed - service.a_rejected - service.a_not_covered,
discount: service} }
As you can see, I just want to have an anchor with href and some data-attributes, and making it one-line won't be a pretty code. But when I do it like above I get an error: "Unbalanced brackets."
any help?
New lines can be placed after commas, according to the Haml documentation. So, perhaps something like the following would work:
%a.open-service{href: '#',
data: { service_name: service.description,
balance_type: "coinsurance",
total: service.a_total_billed - service.a_rejected - service.a_not_covered,
discount: service} }