-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Agregué un header para toda la app. Controller y rutas listas. Actualicé node_modules.
- Loading branch information
1 parent
ee1ffe5
commit 46628fd
Showing
9 changed files
with
172 additions
and
188 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,23 @@ | ||
# LAB1 | ||
# LAB3 | ||
|
||
## Objetivos | ||
|
||
Familiarizarse con los comandos básicos de git y con la consola de rails. | ||
Familiarizarse con las vistas en rails. | ||
|
||
## Notas | ||
|
||
- Los comandos deben ejecutarse en la consola del sistema. | ||
- Para salir de la consola de Rails se debe ejecutar `quit`. | ||
- La base de datos tiene monstruos y tweets. | ||
|
||
## Pasos previos | ||
|
||
1. Crear una cuenta en github si no tienen una [https://github.com/signup](https://github.com/signup) | ||
1. Forkear el repositorio del laboratorio [https://github.com/I110IS/lab1/fork](https://github.com/I110IS/lab1/fork) | ||
1. Crear una cuenta en [Gitpod](https://gitpod.io/login/) | ||
1. Abrir el repositorio forkeado del laboratorio en Gitpod (por ejemplo: [https://gitpod.io/github.com/ruso420/lab1](https://gitpod.io/github.com/ruso420/lab1)) | ||
1. Esperar que termine la configuración del entorno | ||
1. Actualizar la integración de Github en Gitpod [https://gitpod.io/integrations](https://gitpod.io/integrations) para incluir los permisos: `public_repo`, `repo` | ||
|
||
Las últimas lineas de la configuración del entorno se verán así: | ||
``` | ||
Bundle complete! 14 Gemfile dependencies, 64 gems now installed. | ||
Use `bundle info [gemname]` to see where a bundled gem is installed. | ||
== Preparing database == | ||
Created database 'lab1_development' | ||
Done. | ||
== Removing old logs and tempfiles == | ||
== Restarting application server == | ||
``` | ||
|
||
# Parte 1 - Git | ||
|
||
Recomendación: Ver el estado de git después de cada paso. | ||
|
||
1. Crear una nueva rama llamada "agregar-hirb" | ||
1. Agregar una nueva línea con `gem "hirb"` al final del archivo _Gemfile_ | ||
1. Instalar la nueva gema | ||
1. Agregar todos los archivos modificados para ser considerados en el siguiente commit | ||
1. Crear el commit y asignarle un mensaje coherente con los cambios agregados | ||
1. Pushear los cambios de la rama local a una rama en el repositorio remoto | ||
1. Mergear en master/main, los cambios de la nueva rama | ||
1. Pushear los cambios de la rama master/main al repositorio remoto | ||
1. Verificar que la historia de la rama principal contiene el commit realizado previamente | ||
|
||
# Parte 2 - La consola de rails | ||
|
||
1. Abrir la consola de Rails | ||
1. Habilitar la gema Hirb con `Hirb.enable` | ||
1. Obtener el monstruo con ID 1 | ||
1. Crear 3 monstruos | ||
1. Obtener el último monstruo sin usar el ID | ||
1. Obtener los monstruos ordenados por nombre | ||
1. Actualizar al monstruo llamado Nahuelito para que se llame Voldemort | ||
1. Eliminar el monstruo con ID 2 | ||
1. Obtener los últimos 5 tweets de Drácula ordenados por fecha de creación en orden descendente | ||
- Se debe usar el workspace del lab1 | ||
- Si la DB está con datos no deseados pueden resetearla con `rails db:reset` | ||
- La aplicación ya tiene bootstrap instalado | ||
|
||
## Práctica | ||
|
||
1. Actualizar el archivo `app/views/monsters/show.html.erb` para que muestre el nombre como título y la descripción como párrafo. El monstruo está disponible en la variable `@monster`. Usar los tags de HTML correspondientes. | ||
1. Actualizar el archivo `app/views/monsters/index.html.erb` para que muestre un listado o una tabla de todos los monstruos. Los monstruos están disponibles en la variable `@monsters`. | ||
1. Actualizar el listado de monstruos del punto previo para que se pueda hacer click sobre el nombre del monstruo y se redirija a la página del monstruo (el template show del punto 1) | ||
1. Actualizar el listado de monstruos para que muestre "**Twitero Destacado**" en color rojo junto a los monstruos que tengan más de 1 tweet. | ||
1. Usar el atributo style | ||
1. Usar el archivo de estilos (`app/assets/stylesheets/application.bootstrap.scss`) | ||
1. Actualizar la vista de un monstruo para que incluya un botón para eliminar al monstruo. El botón debe ser de color rojo. | ||
1. Actualizar la vista de un monstruo para que muestre los tweets del monstruo. Se deben mostrar la información en dos columnas, la primera columna muestra la información del monstruo y el botón para borrar, la segunda columna debe mostrar el listado de tweets del monstruo. | ||
1. Agregar un pie de página a todas las páginas del sitio. El pie de página debe incluir el siguiente texto: "Copyright © 2022". |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class MonstersController < ApplicationController | ||
def index | ||
@monsters = Monster.all.order(name: :desc) | ||
end | ||
|
||
def show | ||
@monster = Monster.find(params[:id]) | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<header class="text-bg-dark p-3"> | ||
<div class="container"> | ||
<%= link_to root_path, class: "d-flex align-items-center text-decoration-none text-white" do %> | ||
<%= image_tag "superyeti.png", width: 75 %> | ||
<span class="fs-4">Critter</span> | ||
<% end %> | ||
</div> | ||
</header> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%# Update me %><%= @monsters.inspect %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%# Update me %><%= @monster.inspect %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
Rails.application.routes.draw do | ||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html | ||
resources :monsters, only: [:index, :show] | ||
|
||
# Defines the root path route ("/") | ||
# root "articles#index" | ||
root "monsters#index" | ||
end |
Oops, something went wrong.