http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
http://guides.rubyonrails.org/migrations.html
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<%= message %> | |
</div> | |
<% end %> |
// layout file | |
<body> | |
<div class="container"> | |
<%= flash_messages %> | |
<%= yield %> | |
</div><!-- /container --> | |
</body> |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
# -*- encoding : utf-8 -*- | |
# config/deploy.rb | |
require 'capistrano/ext/multistage' | |
require "rvm/capistrano" | |
require 'bundler/capistrano' #Using bundler with Capistrano | |
require 'cape' | |
set :stages, %w(staging production) | |
set :default_stage, "production" |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)printSpecial([12, 33, 144, 122])
# 12 -- 33 -- 144 -- 122
group :development do | |
# Spring speeds up development by keeping your application running in the background. | |
#> https://github.com/rails/spring | |
gem 'spring' | |
# Better Errors replaces the standard Rails error page with a much better and more useful error page. | |
#> https://github.com/charliesome/better_errors | |
gem 'better_errors' | |
gem 'binding_of_caller' # adding REPL |
Gmaps4rails is developed to simply create a Google Map with overlays (markers, infowindows…).
googlemaps
, select the READM, license, and rails .gitignroe filecd googlemaps
rails _4.1.6_ new . -BGT
git add -A