A collaborative emoji story maker application.
M
Start a ticket on PivotalTracker and add yourslef as an owner.
git checkout -b features/#114927735_add-bootstrap
Replace the number above with the number of the issue you are working on in Pivotal Tracker. Be sure to include the #
Make sure you are using Ruby version 2.3.0 & Rails Version 4.2.5
$ git clone https://github.com/LARailsLearners/emojis.git
$ bundle install
$ rails s
Everytime you run tests locally, you will also regenerate Simplecov coverage docs. Make sure you commit these last, after your PR has already been approved.
https://github.com/colszowka/simplecov
http://www.cakesolutions.net/teamblogs/brief-introduction-to-rspec-and-simplecov-for-ruby
A Version Manager allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems. This means you can have multiple version of Ruby installed and choose when you want to use them from project to project.
You don't have to do this but here's some information on using Gemsets.
RVM Gemset Basics
RVM gives you compartmentalized independent ruby setups. This means that ruby, gems and irb are all separate and self-contained - from the system, and from each other.
https://rubygems.org/gems/bootstrap-sass
https://github.com/twbs/bootstrap-sass
- Add the bootstrap-sass gem to your
Gemfile
gem 'bootstrap-sass', '~> 3.3', '>= 3.3.6'
- $
bundle
- Rename
application.css
toapplication.scss
- Import Bootstrap styles in
app/assets/stylesheets/application.scss
/*
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";
- Add
//= require bootstrap-sprockets
toapp/assets/javascripts/application.js
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
//= require turbolinks
//= require_tree .
Let's roll our own auth per http://railscasts.com/episodes/250-authentication-from-scratch
Find more info: https://github.com/rspec/rspec-rails
- In Gemfile "group :test" add the following:
gem 'rspec'
- In the terminal:
$bundle install
- (Initialize the spec/ directory (where specs will reside) In the terminal:
$rails generate rspec:install
- To run written specs:
$bundle exec rspec
- belongs to user
- no tests required
===
Used Story
as the Model name as there was a conflict with the word Emoji (either because the app is named emoji or the word is reserved by Rails).
- Generate Model
$rails g model Emoji emoji:string --no-test-framework
$ rake db:migrate
- Associate User
app/models/story.rb
+ belongs_to :user
- belongs to user
- no tests required
===
Used Story
as the Model name as there was a conflict with the word Emoji (either because the app is named emoji or the word is reserved by Rails).
- Generate Model
$rails g model Emoji emoji:string --no-test-framework
$ rake db:migrate
- Associate User
app/models/story.rb
+ belongs_to :user
---### Add Seed file
- Have it generate 25 Users with first_name, last_name, email, password
- And
- Have it generate 25 Emojis
===
Used Faker to generate 25 random users in db.
- Seed database
$rake db:seed