'How can I write this in haml? (rails app)

<a href="/">
  <i class="material-icons">file_download</i>
  Export to CSV
</a>

I am using a material_icon gem. "file_download" is a download icon in a material icon. I want it to be like a button with the download icon and the text "Export to CSV" next to it.



Solution 1:[1]

Should be something like:

= link_to foo_path do
  %i.material-icons file_download
  Export to CSV

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kouroubel