Module: Alexandria::Helpers
Instance Method Summary collapse
Instance Method Details
#book_path(author, title) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/alexandria/helpers.rb', line 10 def book_path(, title) = normalise() normal_title = normalise(title) path = File.join(, normal_title) File.join LIB_ROOT, path end |
#normalise(title) ⇒ Object
6 7 8 |
# File 'lib/alexandria/helpers.rb', line 6 def normalise(title) title.gsub(' ', '_').gsub(/\W/, '').gsub('_', '-').downcase end |