I have some doubts about the diference beetwen 'for' and 'each' Iterators on Ruby on rails.
I have this case, how is the best practice for this?
Def(method) present in the application_helper.rb file:
def milestone_icons
icons = ["", "icon-world", "icon-star-twohdd-o", "icon-users", "icon-notification", "icon-clock", "icon-eye", "icon-like-filled", "icon-credit-card", "icon-bell" ]
end
Select present in the haml file:
%select.js-select-icons{style: 'width: 50px', name: 'milestone[icon]'}
- for icon in milestone_icons do
%option{value: icon, type: "icon", selected: (@generic.icon == icon)}
= "<i class='#{icon}'></i>".html_safe