We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fcc7a6 commit f3fa6d9Copy full SHA for f3fa6d9
app/controllers/books_controller.rb
@@ -14,9 +14,9 @@ def sotechsha2_show; render_book_page(params); end
14
private
15
16
def render_book_page(params)
17
- book_name = params[:action].split('_').first
18
- Book.exist?(book_name, params[:page]) ?
19
- render("books/#{book_name}/#{params[:page]}") :
20
- redirect_to('/' + book_name) # TODO: Show flash
+ book_title = params[:action].split('_').first
+ Book.exist?(book_title, params[:page]) ?
+ render("books/#{book_title}/#{params[:page]}") :
+ redirect_to("/#{book_title}", flash: { warning: '該当するページが見つかりませんでした 💦'} )
21
end
22
0 commit comments