Dictionary index and show styling

This commit is contained in:
maddiebaka
2023-10-23 11:37:20 -04:00
parent 366921b1d3
commit e73a6b3fc9
5 changed files with 62 additions and 8 deletions

View File

@@ -1,10 +1,14 @@
module DictionaryHelper
LETTERS = ['i', 'u', 'e', 'o', 'a', 'm', 'n', 'p', 't', 'k', 's', 'w', 'l', 'j'].sort
def alphabetical_links
def alphabetical_links(letter = nil)
LETTERS.map do |l|
link_to l.to_s, dictionary_path(l)
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