font awesome rails
Step 1: Add the 'font-awesome-rails' gem to your Rails application by including it in the Gemfile:
gem 'font-awesome-rails'
Step 2: Install the gem using the bundle command:
bundle install
Step 3: In your application's stylesheet file (e.g., 'app/assets/stylesheets/application.css' or 'app/assets/stylesheets/application.scss'), include the Font Awesome styles using one of the following methods:
For Sprockets:
//= require font-awesome
For Sass:
@import "font-awesome";
Step 4: Restart your Rails server to apply the changes.
Now, you can use Font Awesome icons in your views by adding HTML tags with the appropriate classes. For example:
<i class="fas fa-camera"></i> <!-- Solid style camera icon -->
<i class="far fa-envelope"></i> <!-- Regular style envelope icon -->
Refer to the Font Awesome documentation for a complete list of icons and their respective classes: https://fontawesome.com/icons