My profile: https://about.me/alexandrecalaca
1. Check your Rails version
rails -v
- Open the Gemfile and replace the line "gem 'sqlite3" with gem 'pg', '~> 0.21'
gem 'pg', '~> 0.21'
My profile: https://about.me/alexandrecalaca
1. Check your Rails version
rails -v
gem 'pg', '~> 0.21'
Remove files from the repository based on your .gitignore without deleting them from the local file system | |
git rm --cached `git ls-files -i -X .gitignore` | |
This is block
\ It creates a line break
''' Test '''
Header
My profile: https://about.me/alexandrecalaca
1. Check you RVM version
rvm version
You`re going to a message like this: rvm 1.29.2 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]
2. Uninstall RVM gem
My profile: https://about.me/alexandrecalaca
1. Update your system
sudo apt-get update
2. Install build-essential
sudo apt-get install -y build-essential
Check my website: www.alexandrecalaca.com.br
Now, it's time to rock. Go to rails console.
rails console
Create one blog and see the slug created
Check my website: www.alexandrecalaca.com.br
rails generate migration add_post_status_to_blogs status:integer
def change
add_column :blogs, :status, :integer, default: 0
Visit my website: www.alexandrecalaca.com.br
In our example, there are2 models: Blog and Topic. Think about a single topic blog.
So, A blog can belong to only one topic. A topic has many different blogs.
Blog (N) X (1) topic The foreign key needs to be in the blog model.
Lookup Active Record Query Interface http://guides.rubyonrails.org/active_record_querying.html
ActiveRecord::QueryMethods http://api.rubyonrails.org
Class methods http://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html
PostgreSQL command line cheatsheet-ac.md
sudo -u postgres psql
: Enter the console
\password postgres
: E
\du
: List all users
\l
: List of databases
\q
: Disconnect