###On your computer
Create a new folder in ~/ga_wdi
called drills
Initalize a new git repo in drills
Add a Ruby file called first_date.rb
Add and commit the file
###On Github
Create a new repo called drills
1. Create javascript file in folder with data you want to render. For example, I want a list of service providers so I ahve to go into views>service_providers and I will put my javascript index file in there: | |
I will be rendering out of the index page so I am going to label my file | |
index.js.erb | |
2. In my views>service_providers>>index.html.erb I have a partial with the list of service providers. I wrapped that content in a div with an id called "service-providers-list". This will allow me to pull that information into jquery | |
<section class="main col col-lg-7"> | |
<div id="service-providers-list"> |
Name | |
mkdir config db helpers lib models public routes views | |
mkdir db/migrate | |
touch config.ru Gemfile main.rb Procfile README | |
touch database.yml environments.rb unicorn.rb | |
touch helpers/helper1.rb | |
touch helpers/init.rb |
#Gemfile | |
group :development, :test do | |
gem 'pry-rails' # Causes rails console to open pry | |
# https://github.com/rweng/pry-rails | |
gem 'pry-debugger' # Adds step, next, finish, and continue commands and breakpoints | |
# https://github.com/nixme/pry-debugger | |
gem 'pry-stack_explorer' # Navigate the call-stack | |
# https://github.com/pry/pry-stack_explorer | |
gem 'annotate' # Annotate all your models, tests, fixtures, and factories | |
# https://github.com/ctran/annotate_models |
development: | |
adapter: postgresql | |
encoding: unicode | |
database: <%= File.basename(Rails.root) %>_development | |
pool: 5 | |
host: localhost | |
username: <%= ENV['PG_USERNAME'] %> | |
password: | |
test: |
# Configure Rspec to print nice | |
RSpec.configure do |config| | |
# Use color in STDOUT | |
config.color_enabled = true | |
# Use color not only in STDOUT but also in pagers and files | |
config.tty = true | |
# Use the specified formatter | |
config.formatter = :documentation # :progress, :html, :textmate | |
# immediately stop running upon first failure | |
config.fail_fast = true |
Example of Git Cloning | |
mkdir Projects | |
cd Projects | |
git clone git@github.com:ml242/courtPO.git | |
cd courtPO | |
cd courtPO //just in case it is two files deep | |
bundle install // You need to install any gems | |
rake db:create //create database | |
rake db:migrate // migrate any models |
Create a new Repository aside from the one that already exists for a project. | |
Go into the file you want to push up. | |
ex: CourtPOv1 | |
Get the git name and push up to it in the terminal. I substitute tasha for origin. That can be anything you want it to be. | |
$ git remote add tasha git@github.com:Tasha25/CourtPOv1.git |
rails new app | |
rake db:create; rake db:migrate | |
Added new input fied so you can add photos. | |
If you have folder you can just click on the button and we will upload it |
## This is saying the same thing | |
def current_user | |
if session[:user_id] | |
@current_user ||= User.find(session[:user_id]) | |
end | |
end | |
helper_method :current_user |