rails generate model User username email role critics_count:integer
rails g model Critic title body:text user:references
rails g model Company name description:text start_date:date country cover
rails g model Game name summary:text release_date:date category:integer rating:decimal cover
rails g model Platform name category:integer
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
| class TodoList | |
| attr_accessor :items | |
| def initialize | |
| @items = [] | |
| end | |
| def add_item(description) | |
| @items << { description: description, completed: false } | |
| 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
| def notes_page | |
| puts "Tabla de las notas" | |
| action = "" | |
| until action == "logout" | |
| action = get_with_options(["create", "update", "delete", "toggle", "trash", "logout"]) | |
| case action | |
| when "create" then puts "Create note action" | |
| when "update" then puts "Update note action" | |
| when "delete" then puts "Delete note action" | |
| when "toggle" then puts "Toggle note action" |
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
| <!DOCTYPE html> | |
| <html lang="es"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Portafolio de Programador</title> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@400;700&display=swap" rel="stylesheet"> | |
| <style> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Transitions</title> | |
| <link rel="stylesheet" href="/assets/css/style.css"> | |
| <style> |
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
| SELECT nombre_departamento, COUNT(*) AS total_empleados | |
| FROM empleados JOIN departamento ON departamento.id_departamento = empleados.id_departamento | |
| GROUP BY nombre_departamento; |
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
| def print_welcome | |
| puts "Welcome to Booking" | |
| puts "Write 'menu' at any moment to print the menu again and 'exit' to quit" | |
| end | |
| def print_menu | |
| puts "---" | |
| puts "1. Top 5 publisher by annual revenue" | |
| puts "2. Search books by [title=string | author=string | publisher=string]" | |
| puts "3. Count books by [author | publisher | genre]" |
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
| module Presenter | |
| def print_welcome | |
| # print the welcome message | |
| puts ["###################################", | |
| "# Welcome to Clivia Generator #", | |
| "###################################"].join("\n") | |
| end | |
| def print_score(score) | |
| puts "Well done! Your score is #{score}" |
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 "json" | |
| companies_data = JSON.parse(File.read("db/data/companies.json")) | |
| games_data = JSON.parse(File.read("db/data/games.json")) | |
| genres_data = JSON.parse(File.read("db/data/genres.json")) | |
| platforms_data = JSON.parse(File.read("db/data/platforms.json")) | |
| puts "Start seeding" | |
| Company.destroy_all |
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
| <body> | |
| <header> | |
| <div class="container"> | |
| <div class="header navbar"> | |
| <%=link_to image_tag("/images/logo.png"), departments_path%> | |
| <%=form_with url: "/search", method: :get do |f|%> | |
| <%=f.label :consulta, "Search employees: " %> | |
| <%=f.text_field :consulta %> | |
| <%end%> | |
| </div> |
OlderNewer