This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rails', '3.2.6' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'mysql2' | |
gem 'heroku' | |
gem 'newrelic_rpm' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rails new albertsproject | |
$ cd albertsproject | |
$ Add to gemfile | |
group :development, :test do | |
gem 'rspec-rails' | |
gem 'cucumber-rails' | |
gem 'capybara' | |
end | |
$ bundle install | |
$ rails generate --help **view generators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MYSQL | |
----------- | |
Run this on the command line. Not in mysql console. | |
eg. $alberta_makeever: mysql -u root -p user_development << sample.sql | |
mysql5 -u root -p | |
enter password:kwame1 | |
mysql> exit; | |
Order.includes(:order_products).where("order_products.product_id = 16227").references(:order_products) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it-macbook-albert:BDD_Testing albertmckeever$ rails generator integration_test -h (specific help) | |
it-macbook-albert:BDD_Testing albertmckeever$ rails generator -h | |
Usage: rails generate GENERATOR [args] [options] | |
General options: | |
-h, [--help] # Print generator's options and usage | |
-p, [--pretend] # Run but do not make any changes | |
-f, [--force] # Overwrite files that already exist | |
-s, [--skip] # Skip files that already exist | |
-q, [--quiet] # Suppress status output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Miscellenaeous | |
------------------- | |
cd ../.. | |
pwd - displays path | |
grep -ir acts_as_json - display acts_as_jason in which file | |
gem list | grep rspec - list all rspec associated files | |
gem list | grep friendly_id | |
grep rspec Gemfile.lock - displays all rpec gem in the gemfile.lock. You shud b in dir. | |
Bundler Primary Command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Apple shortcut | |
--------------- | |
alt + cmd + D - hide bar | |
cntl + alt + cmd + t - edit templete - contains all the shortcuts for the templates. | |
alt + cmd + right arrow - go to next file on tab | |
alt + cmd + down arrow - will open | |
ctrl + Shift + D - Duplicate line/selection - selected text is duplicated | |
cmd + ] - move block of code to right |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#gemfile | |
gem 'debugger', group: [:development, :test] | |
#/app/controllers/tasks_controller.rb | |
def index | |
debugger | |
@today_tasks = Task.due_on(Date.today) | |
end | |
#terminal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ../.. | |
grep -Rni 'albert' . | |
pwd - displays path | |
grep -ir acts_as_json - display acts_as_jason in which file | |
gem list | grep rspec - list all rspec associated files | |
gem list | grep friendly_id | |
grep rspec Gemfile.lock - displays all rpec gem in the gemfile.lock. You shud b in dir. | |
bundle - install gems from gemfile | |
rvm help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step B.) Creating a branch (and switching to the new branch in one line (Step 2) | |
********** | |
a.) git checkout -b [name of new branch] | |
eg. git checkout -b 2012Tryme | |
git fetch origin [remote-branch]:[new-local-branch] (Pulling a new branch from a remote repository) | |
b.) follow step 1 | |
c.) git push origin 2012Tryme | |
** will add new branch to the repository on git hub | |
********************** | |
Step A.) Scheduling the addition of all files to the next commit (Step 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources :users | |
resources :sessions, only: [:new, :create, :destroy] | |
match '/signup', to: 'users#new' | |
match '/signin', to: 'sessions#new' | |
match '/signout', to: 'sessions#destroy', via: :delete | |
get "users/new" |