2023-10-13 00:02:22 +00:00
|
|
|
module DictionaryHelper
|
2023-10-20 18:29:34 +00:00
|
|
|
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)
|
2023-10-20 18:29:34 +00:00
|
|
|
|
|
|
|
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
|
2023-10-20 18:29:34 +00:00
|
|
|
end.join("\n")
|
|
|
|
end
|
2023-10-13 00:02:22 +00:00
|
|
|
end
|