Search code examples
ruby-on-railsinternationalizationtwitter-bootstrapflash-message

rails - how to customize flash message color in i18n


i was wondering how i could do a flash[:success] in i18n? im quite new to it, but ive looking at http://guides.rubyonrails.org/i18n.html

ive trying to change the flash color in a yml file. i currently have..

en:
  merit:
    flashs:
      badge_granted: "Congratulations!"

:merit is a key word, found in a gem where the flash occurs with the line

flash[:merit] = t('merit.flashs.badge_granted', :badge => Badge.find(badge_id).name)

i was wondering if it was possible to do a :success message? im using twitter bootstrap, and the :success are colored green while :notice are colored orange. i essentially just want a green flash notification to occur, as opposed to the orange color. how can i do this?

thank you


Solution

  • You customize colors using css. Give it the same class in your views as bootstrap would use and you're good to go.