Add Weather Icons to your Ruby on Rails App
Rails Icons is a library-agnostic Rails gem with support for Weather. Icons are sourced from the Weather GitHub repo. Use any of the 215+ icons in your app.
Install
Add the rails_icons gem:
bundle add rails_icons
Install, by creating the initializer and sync the available sunrise icons.
rails generate rails_icons:install --libraries=weather
Usage
icon "sunrise"
# Add CSS
icon "sunrise", class: "text-green-500"
# Add data attributes
icon "sunrise", data: { controller: "swap" }
Sync icons
If Weather gets updated, sync the icons with
rails generate rails_icons:sync