Skip to content

Commit 1a490c5

Browse files
committed
Little UX formatting of books sneaking in
1 parent d23947c commit 1a490c5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/helpers/application_helper.rb

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ def book_title book
99
"Book #{book.name.titleize}"
1010
end
1111
end
12+
13+
def strip_book_title book
14+
book.name.sub(/^book\s+/i, '').titleize
15+
end
1216

1317
def case_title kase
1418
if kase.case_name.downcase.starts_with?('case')

app/views/books/_book.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<% puts "Rendering row for book #{book.id} updated at #{book.updated_at} at #{Time.now}"%>
33
<!--<%= "Rendering row for book #{book.id} updated at #{book.updated_at} at #{Time.now}"%>-->
44
<td><%= book.id %> </td>
5-
<td><%= link_to book_title(book), book_path(book) %></td>
5+
<td><%= link_to strip_book_title(book), book_path(book) %></td>
66
<td><%= book.teams.pluck(:name).join(',') %></td>
77
<td><%= book.scorer.name %> </td>
88
<td><%= book.selection_strategy.name %> </td>

0 commit comments

Comments
 (0)