guillermo{at}guerreroibarra{dot}com
Follow me on github: https://github.com/ryanfox1985
May 25th, 2016
$ rails --help
$ rails new blog
$ cd blog; rails s
$ cd blog; rails c
|____app
| |____assets
| |____controllers
| |____helpers
| |____mailers
| |____models
| |____views
|____bin
|____config
|____db
|____Gemfile
|____lib
|____log
|____public
|____test
|____tmp
|____vendor
Database configurations, application behaviours, code inline
$ rails g scaffold post title:string content:text
$ rails g scaffold comment post:references author:string opinion:text
# db/seeds.rb
10.times do
p = Post.create(title: Faker::Hipster.sentence, content:Faker::Hipster.paragraph)
5.times do
Comment.create(post: p, author: Faker::App.author, opinion: Faker::Hipster.sentence)
end
end
#test/test_helper.
require 'simplecov'
SimpleCov.start