When you work on a Rails project you want your .git repo to be in the root of your Rails App.
This is very important for hosting your app on Heroku.
Many of you have the following repo structure:
# A project folder, with a rails app inside of it.| group :development, :test do | |
| gem 'launchy' | |
| gem 'capybara' | |
| gem 'pry-rails' | |
| gem 'rails-erd' | |
| gem 'rspec-rails', '~> 3.0.0.beta' | |
| gem 'jasmine' | |
| gem 'shoulda-matchers' | |
| gem 'factory_girl_rails' | |
| gem 'rubocop' |
| <% if flash[:msg] %> | |
| <%= flash[:msg] %> | |
| <% end %> | |
| ------------------------------- | |
| <%= link_to "Sign Up", new_user_path(@user) %> | |
| ------------------------------- | |
| edit.html.erb (hipchat history) | |
| <%= render 'form' %> | |
| ------------------------------- | |
| <%= form_for(@user) do |f| %> |
| --- HEROKU STEPS to SET UP: --- | |
| (Make sure you're all pushed/pulled on master before doing anything heroku) | |
| 1. git init | |
| 2. git add -A | |
| 3. git commit -m “blah, blah” | |
| 4. heroku create | |
| 5. To add heroku ENV keys/variables → (If there are any). |
| # What about including `pry`, `rspec` or `guard`? | |
| # They're loaded automatically as dependencies | |
| group :development, :test do | |
| # Annotates ActiveRecord Models, routes and others based on the database schema | |
| gem "annotate" | |
| # generates entity relationship diagrams based on Active Record models | |
| # Postscript bugs may be fixed with: |
| ---------------------------------------------------------------------- | |
| #### Steps to create Rails App #### | |
| ---------------------------------------------------------------------- | |
| 1.) rails new app_name -d postgresql | |
| 'Jesse's way': rails g model Complaint descriptor:string address:string latitude:decimal longitude:decimal zip:integer | |
| 2.) database.yml → 'Phil's gist' | |
| - put in: echo $USER in the terminal right after to make sure it works. | |
| 3.) rake db:create | |
| 4.) Insert ‘gem’ gist for development: |
| group :development, :test do | |
| gem 'pry-rails' | |
| gem 'rspec' | |
| gem 'rspec-rails' | |
| gem 'guard' | |
| gem 'guard-rspec' | |
| gem 'guard-bundler', require: false | |
| gem 'terminal-notifier-guard' | |
| gem 'shoulda-matchers' | |
| end |
| #put $ echo $USER cgelinas in the terminal RIGHT AFTER putting this in your database.yml file! | |
| development: &defaults | |
| adapter: postgresql | |
| encoding: unicode | |
| pool: 5 | |
| host: localhost | |
| username: <%= `echo $USER`.chomp %> | |
| password: | |
| database: <%= File.basename(Rails.root) %>_development |