Rails Devise I18n Flash Messages with Twitter Bootstrap

后端 未结 6 681
轻奢々
轻奢々 2020-12-23 23:47

Hello I am new to ruby on rails and I am struggling to understand I18n\'s flash messages. I am using devise, rails 4, and twitter bootstrap.I understand that devise only use

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 00:32

    If you use Sass in your app, you can extend BS classes alert-info and alert-danger with Devise's alert-notice and alert-alert respectively, in a way like this:

    .alert-notice {
      @extend .alert-info
    }
    
    .alert-alert {
      @extend .alert-danger
    }
    

    By adding this to your *.scss, Devise flash messages will inherit the styles of BS info and danger alerts.

    http://sass-lang.com/guide (Extend/Inheritance section)

提交回复
热议问题