Skip to content
Team project.
Ruby HTML CSS Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db
lib
log
public
spec
test
vendor/assets
.gitignore
.rspec
Gemfile
Gemfile.lock
Guardfile
README.md
Rakefile
config.ru

README.md

Project 2

  • Project Title: Travelogue
  • Trello Board
  • C9 Online
  • Framework: Rails 4.0
  • APIs Used: Google Maps (Places api)

Check the Trello board for the most recent updates and planning for on-going work. This repo is used for issue and milestone tracking.


Getting Started

  • Run bundle install
  • Run rake db:schema:load for NEW installs only.
  • Run rake db:migrate to update database between pulls.
  • Run rake db:seed to populate the site with fake articles and users. Old users will not be removed.

The following gems require configuration: rspec, capybara, devise

RSpec

  • rails generate rspec:install
  • require "rails_helper" goes at the top of new _spec files.
  • Further reading: Github - Documentation

Shoulda-Matchers

  • require 'shoulda/matchers' in rails_helper.rb

Capybara

  • require 'capybara/rails' to rails_helper.rb
  • Create a features folder in the spec directory (spec/features)
  • Further reading: Github - Documentation

Devise

  • rails generate devise:install
  • in config/environments/development.rb add: config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
  • Add this to controllers where authentication is required: before_action :authenticate_user!
  • Further reading: Github - Documentation

Pundit

  • Add the following to application_controller.rb at top of class:
  • include Pundit
  • Create a policies folder in the app directory (app/policies)
  • Documentation

Paperclip

  • Ensure Imagemagick is installed on your computer. Use your terminal install command (e.g. brew install imagemagick).
  • Add the following to config/environments/development.rb: Paperclip.options[:command_path] = "/usr/local/bin/"
  • Add the following to the appropriate model:
  • has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png" validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
  • Documentation

Optional Gems

guard-rspec simply runs your specs automatically in the background.

  • guard init rspec to configure
  • Run in it's own terminal in your rails directory, as you would a rails server.
  • bundle exec guard (or guard) to start
  • Documentation

simplecov simply measures the amount of test coverage for our entire app.

  • Add to top of rails_helper.rb:
  • require 'simplecov' SimpleCov.start
  • Documentation
You can’t perform that action at this time.