TokiTranslate/app/helpers/dictionary_helper.rb

15 lines
396 B
Ruby
Raw Permalink Normal View History

module DictionaryHelper
LETTERS = ['i', 'u', 'e', 'o', 'a', 'm', 'n', 'p', 't', 'k', 's', 'w', 'l', 'j'].sort
2023-10-23 15:37:20 +00:00
def alphabetical_links(letter = nil)
LETTERS.map do |l|
2023-10-23 15:37:20 +00:00
if l == letter then
"<p class=\"selected-letter\">#{l.to_s}</p>"
else
link_to l.to_s, dictionary_path(l)#, class: "dictionary_index_links text-center"
end
end.join("\n")
end
end