i'm trying indent options in select list of categories based upon hierarchical level, e.g. category, subcategory, subsubcategory.
i've tried: <% options = options_for_select @categories.map{|c| [(" " * c.level) + c.name, c.id]} %>, renders &nsbp;subcategory , subsubcategory.
i've tried: <% options = options_for_select @categories.map{|c| [(" " * c.level) + c.name, c.id]} %>, ignores spaces , renders subcategory , subsubcategory.
as test, tried <%= (" " * 3) + "hello" %>, , renders how i'd expect to: hello.
does know how results i'm looking for?
try using ((" " * c.level) + c.name).html_safe. problem in options_for_select helper method using html_escape, escapes entities. adding html_safe allow html_escape method called options_for_select helper avoid escaping spaces.
Comments
Post a Comment