Adding Gravatar to your App
Created by Catherine Jones
You need to have an e-mail address registered with Gravatar for this to work. If you do not already have one you can go to gravatar.com.
1. Add the Gravtastic gem
Open up your gemfile and under your
devise gem add
In the terminal run
This will install the gravtastic gem. Then remember to restart your rails server.
2. Set up Gravatar in your app
app/models/user.rb, and add these lines
right after the first line.
3. Configure Gravatar
app/views/layouts/application.html.erb and in the
section but before the
And, put the following code to the bottom of
Now open you app in your browser and login with an e-mail address that is associated with a Gravatar. You should be able to see your Gravatar.
- Handy cheatsheet for Ruby, Rails, console etc.
- Guide 1: Guide to install Rails
- Guide 2: Build Your First App
- Guide 3: Push Your App to GitHub
- Guide 4: Put your app online with…
- Guide 5: Allow Comments on Your App
- Guide 6: Add design using HTML & CSS
- Guide 7: Create thumbnails with Carrierwave
- Guide 8: Add Authentication (user accounts) with Devise
- Guide 9: Add Profile Pics with Gravatar (Current page!)
- Guide 10: Improve your design with HTML and CSS
- Guide 11: Continuous Deployment
- Guide 12: Build a voting app in Sinatra
- Guide 13: Build a diary app in Ruby on Rails
- Guide 14: Add a back-end to your app (admin pages)
- Guide 15: Go through additional explanations for the App