for model in "artists" "galleries" "paintings"
do
mkdir -p $(echo views/api/v1/$model)
for verb in "index" "show"
do
touch $(echo views/api/v1/$model/$verb.json.jbuilder)
done
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
# you can call #sum iterator on it: | |
numbers = [1, 2, 3, 4, 5] | |
numbers.sum | |
# => 15 | |
# N.B: In Ruby versions < 2.4, sum didn't exist. The idiomatic way to get the same result was with #reduce: |
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 db:rollback STEP=1 | |
# Is a way to do this, if the migration you want to rollback is the last one applied. You can substitute 1 for however many migrations you want to go back. | |
# For example: | |
rails db:rollback STEP=5 | |
# Will also rollback all the migration that happened later (4, 3, 2 and also 1). | |
# In order to rollback a specific migration use: |
OlderNewer