0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

学習75日目

Posted at

テーマ

ページネーションをbootstrapで良い感じに整える

前提

  • ruby on railsで開発
  • gem 'kaminari' 導入済
  • bootstrap 導入済
  • 該当部分以外の記述は省略

内容

  1. gem 'bootstrap5-kaminari-views' の導入
    Gemfile
gem 'bootstrap5-kaminari-views'

terminal

bundle install
  1. pagination部分へ「theme: 'bootstrap-5'」を追記
    app/views/hoges/index.html.erb
    (before)

    <%= paginate @hoges %>
    

    (after)

    <%= paginate @hoges, theme: 'bootstrap-5' %>
    
  2. (おまけ)ja.ymlの編集
    config/locals/ja.yml

      views:
          pagination:
              first: <i class="fas fa-angle-double-left"></i>
              last: <i class="fas fa-angle-double-right"></i>
              previous: <i class="fas fa-angle-left"></i>
              next: <i class="fas fa-angle-right"></i>
              truncate: "..."
    

コメント

bootstrapの活用により、最初よりはるかに見やすいアプリになった。
google mapと画像プレビューの部分のCSSも工夫したい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?