This file contains hidden or 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
| if num1 == "q" | |
| puts "Thanks, bye!" | |
| elsif |
This file contains hidden or 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
| helpers do | |
| def db_exec(sql) | |
| conn = PG.connect(:dbname =>'DB_NAME', :host => 'localhost') | |
| result = conn.exec(sql) | |
| conn.close | |
| result | |
| end | |
| end |
This file contains hidden or 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
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new( STDOUT ) | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => "postgresql", | |
| :host => "localhost", | |
| :username => "philco", | |
| :password => "", | |
| :database => "amazon_db" |
This file contains hidden or 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
| group :development do | |
| gem 'better_errors' # Replaces the standard Rails error page with a much better and more useful error page | |
| # https://github.com/charliesome/better_errors | |
| end | |
| group :development, :test do | |
| gem 'capybara' | |
| gem "rspec-rails" |
This file contains hidden or 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
| development: | |
| adapter: postgresql | |
| encoding: unicode | |
| database: <%= File.basename(Rails.root) %>_development | |
| pool: 5 | |
| host: localhost | |
| username: <%= ENV['PG_USERNAME'] %> | |
| password: | |
| test: |
This file contains hidden or 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
| get '/countries' => 'countries#index' # | |
| get '/countries/new' => 'countries#new' # | |
| post '/countries' => 'countries#create' # | |
| get '/countries/:id' => 'countries#show' # | |
| get '/countries/:id/edit' => 'countries#edit' # | |
| post '/countries/:id' => 'countries#update' # | |
| post '/countries/:id/delete' => 'countries#destroy' # |
This file contains hidden or 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
| Git checkout -b "twilio_integration" (or feature in quotes that you're working on) | |
| git checkout branch master (obviously moves back to master) | |
| git push origin "twilio_integration" (or feature in quotes - just pushes the branch your working on) | |
| when you're finished | |
| git merge "twilio_integration" <- moves the twilio integration branch into the master branch |
This file contains hidden or 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
| brew install imagemagick | |
| gem install paperclip | |
| -> add paperclip to gem file | |
| gem install aws-sdk | |
| gem 'paperclip' | |
| gem 'aws-sdk' | |
| rails new project |
This file contains hidden or 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
| go to your directory | |
| run --> rspec --init | |
| cd into rspec (this is where you create your helper, i.e. bus_spec.rb), or just use touch to place them | |
| cd .. | |
| run --> rspec spec/ | |
| run --> bundle init | |
| add gem 'rspec' | |
| add gem 'guard-rspec' | |
| run --> bundle install |
This file contains hidden or 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
| i.e. RAILS_ENV = (development, test, production) | |
| Gemfile: | |
| gem "rspec-rails", :group => [:test, :development] | |
| gem 'jquery-rails' | |
| development: | |
| adapter: postgresql |
OlderNewer