Reputation: 1113
I have a dropdown which uses the Ancestry gem and orders the option hierarchically.
It works great using the following code in the controller
@lines = ancestry_options(Line.all.arrange(:order => 'name')) {|i| "#{'-' * i.depth} #{i.name}" }
I have been trying to change the indenting character, defined by "#{'-'
to a double space but rails ignores a space like "#{' '
.
Is there a way I can force it to put a blank space?
Upvotes: 0
Views: 105
Reputation: 3079
The spaces are ignored not by rails, but by HTML. You can try to convert each space to
(non-breaking space), but don't forget to include .html_safe
in the end of you string.
Upvotes: 2