Alan deLevie
← The Website of Alan deLevie
Home
Archive
Pages
Categories
Tags
Trivial Rails tip: easy html spaces
erb
1
nbsp
1
rails
7
ruby
9
For when you don't want to type
a dozen times, add this to application_helper.rb:
def nbsp(n=1) n.times.map {" "} end
In a view:
<%= nbsp 5 %>
replaces
Alan
16 July 2010
Next Post →
← Earlier Post
Please enable JavaScript to view the
comments powered by Disqus.
blog comments powered by
Disqus