-
Add images to your projects & users model using the Paperclip Gem
-
Implement Paperclip by one of three methods: Directly on Model, Through an associated model (Gallery Images), or through polymorphic associations across multiple models.
15.times do | |
u = FactoryGirl.create(:user) | |
pic = Picture.create image: File.open(Dir["/Users/ben/Pictures/Stock\ Photos/people/*.jpg"].sample) | |
u.picture = pic | |
Random.rand(6).times do | |
u.tags.create FactoryGirl.attributes_for(:tag) | |
end | |
Random.rand(10).times do | |
p = u.projects.create FactoryGirl.attributes_for(:project) | |
(1 + Random.rand(6)).times do |
Create a working contact form in your application that will allow a user to send you an email. At a minimum should have a sender email, subject, and body as part of the form. It should have validations that make sure that required fields are submitted & email address is properly formatted. The messages should not be ultimately stored in the database, you can choose how to implement that (Non-active record model vs destroying entries after create)/
- Create a message model
- Create a contact us controller with new & create actions & associated views
- Create a mailer & associated views (use layout if you have one)
- Hook the mailer up to the create action in your contact us controller
Configure your email settings: | |
In config/environments/development.rb: | |
config.action_mailer.delivery_method = :smtp | |
config.action_mailer.smtp_settings = { | |
address: 'smtp.gmail.com', | |
port: 587, | |
domain: 'localhost:3000', | |
user_name: ENV['GMAIL_EMAIL'], | |
password: ENV['GMAIL_PASSWORD'], | |
authentication: 'plain', |
This guide covers the inner working of Savvi's RESTful API. It assumes a basic understanding of the principles of REST.
The REST API is designed to give developers a convenient way to access data contained within Savvi. As Savvi continues to grow, the API will continue to be developed.
Savvi provides a staging and production URL for creating users.
Staging URL: http://www.savvi-staging.com/api/v1/
This guide covers the inner working of Braintree's Payment API & Savvi's RESTful API. It assumes a basic understanding of the principles of REST.
There are two steps that need to happen in order to successfully enroll a Savvi member:
1.) Create an customer with a credit card & billing address with Braintree
2.) Post the user's information to Savvi including the newly created Braintree token via the "Creating Call Center Members via API" method.
# detect `$rvm_path` | |
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ] | |
then rvm_path="${HOME:-}/.rvm" | |
fi | |
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ] | |
then rvm_path="/usr/local/rvm" | |
fi | |
# load environment of current project ruby | |
if |
Today we use computers to mask messages every day. When you connect to a website that uses "https" in the address, it is running a special encoding on your transmissions that makes it very difficult for anyone to listen in between you and the server.