| URL | HTTP Verb | Action |
|---|---|---|
| /photos/ | GET | index |
| /photos/new | GET | new |
| /photos | POST | create |
| /photos/:id | GET | show |
| /photos/:id/edit | GET | edit |
| /photos/:id | PATCH/PUT | update |
| /photos/:id | DELETE | destroy |
First, Create a folder inside of lib called seeds
Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv
Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.
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
| <template> | |
| <div :id="uppyId"> | |
| <div class="ThumbnailContainer" v-if="collection === 'thumbnail'"> | |
| <button id="open-thumbnail-modal" class="button">Select file</button> | |
| </div> | |
| <div class="DashboardContainer" v-else></div> | |
| </div> | |
| </template> |
Para hacer algunos ejemplos de herencia, métodos y atributos de clase vamos a modelar un sistema de nómina para una compañía.
Empezamos con una clase Employee de la cual van a extender otras clases:
class Employee
attr_reader :name, :email, :salary
def initialize(attrs)
@name = attrs[:name]
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
| var findPairs = function(nums, k) { | |
| if (k < 0) return 0 | |
| if (k === 0) { | |
| return handleZeroCase(nums) | |
| } else { | |
| return handleGeneralCase(nums, k) | |
| } | |
| }; | |
| function handleZeroCase(nums) { |