Curso de Creación de APIs con Ruby on Rails

Clases del Curso de Creación de APIs con Ruby on Rails

Instruido por:
Simón Soriano
Simón Soriano
Básico
4 horas de contenido
Ver la ruta de aprendizaje
Curso de Creación de APIs con Ruby on Rails

Curso de Creación de APIs con Ruby on Rails

Progreso del curso:0/33contenidos(0%)

Contenido del Curso
Tutoriales de estudiantes
Preguntas de estudiantes

Progreso del curso:0/33contenidos(0%)

Introducción

Material Thumbnail

Qué aprenderás sobre la creación de APIs con Ruby on Rails

01:35 min

Material Thumbnail

Configuración

01:17 min

Proyecto

Material Thumbnail

Creación del proyecto

04:37 min

Material Thumbnail

Instalación de gemas necesarias

06:26 min

Material Thumbnail

Configurar rspec + factorybot

07:25 min

Material Thumbnail

Hello world (health endpoint)

12:28 min

Material Thumbnail

Casos de uso para nuestra aplicación

03:16 min

Material Thumbnail

Planeando nuestro modelo entidad relación

01:41 min

Material Thumbnail

Crear modelos y validaciones + tests

05:59 min

Material Thumbnail

Implementación de los modelos usando TDD

07:07 min

Material Thumbnail

Listar y mostrar Post: pruebas

15:12 min

Material Thumbnail

Listar y mostrar Post: implementación

10:34 min

Material Thumbnail

Crear y editar POST: pruebas

10:12 min

Material Thumbnail

Crear y editar POST: implementación

10:23 min

Material Thumbnail

Usando ActiveModelSerializer

06:03 min

Material Thumbnail

Filtrar posts - pruebas

05:57 min

Material Thumbnail

Filtrar posts - implementacion

06:06 min

Material Thumbnail

N+1 query problem: explicacion teórica

04:40 min

Material Thumbnail

N+1 query problem: solución

06:20 min

Material Thumbnail

Introducción a la autenticación con Tokens

05:29 min

Material Thumbnail

Autenticación: pruebas del endpoint de detalle (/posts/{id})

12:17 min

Material Thumbnail

Autenticación: generacio de auth token para el usuario

05:54 min

Material Thumbnail

Autenticación: agregando autenticacion al controlador de Post

09:20 min

Material Thumbnail

Autenticación: lógica de update, delete y create del controlador de blogposts

09:17 min

Material Thumbnail

Autenticación: Finalizando pruebas de creación y actualización de blogposts

14:21 min

Material Thumbnail

Probando el API con Postman

10:43 min

Material Thumbnail

Explicación de Caching

07:15 min

Material Thumbnail

Usando Cache para acelerar las búsquedas de posts

08:23 min

Material Thumbnail

Background jobs y ActiveJob (explicación teórica)

05:45 min

Material Thumbnail

Generar Reporte para procesar con ActiveJob

09:45 min

Material Thumbnail

Enviar Reporte usando ActionMailer

11:06 min

Autenticacion con auth0 y JWT

03:48 min

Cierre

nuevosmás votadossin responder
kevin david pantoja vergara
kevin david pantoja vergara
Estudiante

pregunta, no estoy tomando este curso pero agradeceria si alguien me responde esta pregunta, es que necesito crear una api rest para una web que he creado, pero veo que esta api rest esta en localhost, sera que esta api rest se puede mandar a algun servidor que siempre la mantenga activa para producción? muchas gracias

1
Fernando Daniel Burgos
Fernando Daniel Burgos
Estudiante

Como puedo resolver el siguiente error que surge cuando ejecuto en consola bundle exec rspec:

An error occurred while loading ./spec/requests/health_spec.rb.
Failure/Error: config.fixture_path = "#{::Rails.root}/spec/fixtures"

NameError:
  undefined local variable ormethod `config' formain:Object
# ./spec/rails_helper.rb:60:in `<top (required)>'
# ./spec/requests/health_spec.rb:1:in `require'
# ./spec/requests/health_spec.rb:1:in `<top (required)>'
No examples found.


Finished in 0.00006 seconds (files took 5.64 seconds to load)
0 examples, 0 failures, 1error occurred outside of examples
1
Johan José Donado Banderas
Johan José Donado Banderas
Estudiante

No entiendo por qué esta pregunta me sale mala en el examen, si según la explicación no se generaría el problema del N+1 query. Dije que NO pero me marca la respuesta como mala.

select * from invoices where date > '1991-11-01';
select * from invoice_items where invoice_id in (1, 2, 3, 4, 5);

1
Johan José Donado Banderas
Johan José Donado Banderas
Estudiante

Saludos. Las pruebas me están arrojando error en el método create. Alguien sabe qué podría ser?

Gracias.

3) Post GET /post/{id} should return a post
     Failure/Error: let(:post) { create(:post) }     
     NoMethodError:
       undefined method `create'for #<RSpec::ExampleGroups::Post_2::GETPostId "should return a post" (./spec/requests/posts_spec.rb:29)>
./spec/requests/posts_spec.rb:27:in `block (3 levels) in <main>'
./spec/requests/posts_spec.rb:30:in `block (3 levels) in <main>'
1
Isabid Gutierrez Parra
Isabid Gutierrez Parra
Estudiante

En la implementacion me genera este error, favor alguien me puede ayudar?. Gracias

$ bundle exec rspec
FFF…

Failures:

  1. Post validations validate presence of required fields
    Failure/Error: example.run
    name is not available from within an example (e.g. an it block) or from constructs that run in the scope of an example (e.g. before, let, etc). It is only available on an example group (e.g. a describe or context block).

    ./spec/rails_helper.rb:60:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:59:in `block (2 levels) in <top (required)>’

  2. User validations validate presence of required fields
    Failure/Error: example.run
    name is not available from within an example (e.g. an it block) or from constructs that run in the scope of an example (e.g. before, let, etc). It is only available on an example group (e.g. a describe or context block).

    ./spec/rails_helper.rb:60:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:59:in `block (2 levels) in <top (required)>’

  3. User validations validate relations
    Failure/Error: example.run
    name is not available from within an example (e.g. an it block) or from constructs that run in the scope of an example (e.g. before, let, etc). It is only available on an example group (e.g. a describe or context block).

    ./spec/rails_helper.rb:60:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:59:in `block (2 levels) in <top (required)>’

Finished in 0.15207 seconds (files took 1.84 seconds to load)
5 examples, 3 failures

Failed examples:

rspec ./spec/models/post_spec.rb:6 # Post validations validate presence of required fields
rspec ./spec/models/user_spec.rb:5 # User validations validate presence of required fields
rspec ./spec/models/user_spec.rb:11 # User validations validate relations

1
Isabid Gutierrez Parra
Isabid Gutierrez Parra
Estudiante

Hola tengo este error, alguien me puede ayudar.

C:\Isabid\Paginasweb\blogapi>bundle exec rspec
F.

Failures:

  1. Health endpoint GET /health should return OK
    Failure/Error: expect(payload).not_to be_emply
    expected {“api”=>“OK”} to respond to emply?

    ./spec/request/health_spec.rb:10:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:59:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:58:in `block (2 levels) in <top (required)>’

Finished in 0.21116 seconds (files took 2.82 seconds to load)
2 examples, 1 failure

Failed examples:

rspec ./spec/request/health_spec.rb:8 # Health endpoint GET /health should return OK

3
David Santiago Pinchao Ortiz
David Santiago Pinchao Ortiz
Estudiante

El Token se guarda en la base de datos ? o es una especie de hash con la contraseña ?

0
Isabid Gutierrez Parra
Isabid Gutierrez Parra
Estudiante

No he podido pasar el siguiente error…Gracias si me puede ayudar:
C:\Isabid\Paginasweb\blogapi>bundle exec rspec
FF

Failures:

  1. Health endpoint GET /health should return OK
    Failure/Error: example.run
    name is not available from within an example (e.g. an it block) or from constructs that run in the scope of an example (e.g. before, let, etc). It is only available on an example group (e.g. a describe or context block).

    ./spec/rails_helper.rb:59:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:58:in `block (2 levels) in <top (required)>’

  2. Health endpoint GET /health should return status code 200
    Failure/Error: example.run
    name is not available from within an example (e.g. an it block) or from constructs that run in the scope of an example (e.g. before, let, etc). It is only available on an example group (e.g. a describe or context block).

    ./spec/rails_helper.rb:59:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:58:in `block (2 levels) in <top (required)>’

Finished in 0.1422 seconds (files took 5.52 seconds to load)
2 examples, 2 failures

Failed examples:

rspec ./spec/request/health_spec.rb:8 # Health endpoint GET /health should return OK
rspec ./spec/request/health_spec.rb:13 # Health endpoint GET /health should return status code 200

2
Isabid Gutierrez Parra
Isabid Gutierrez Parra
Estudiante

Buenos dias, me esta generando el siguiente error al correr “bundle exec rspec” -----errror
FF

Failures:

  1. Health endpoint GET /health should return OK
    Failure/Error: example.run
    name is not available from within an example (e.g. an it block) or from constructs that run in the scope of an example (e.g. before, let, etc). It is only available on an example group (e.g. a describe or context block).

    ./spec/rails_helper.rb:58:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:57:in `block (2 levels) in <top (required)>’

  2. Health endpoint GET /health should return status code 200
    Failure/Error: example.run
    name is not available from within an example (e.g. an it block) or from constructs that run in the scope of an example (e.g. before, let, etc). It is only available on an example group (e.g. a describe or context block).

    ./spec/rails_helper.rb:58:in `block (3 levels) in <top (required)>’

    ./spec/rails_helper.rb:57:in `block (2 levels) in <top (required)>’

Finished in 0.1694 seconds (files took 5.35 seconds to load)
2 examples, 2 failures

Failed examples:

rspec ./spec/request/health_spec.rb:7 # Health endpoint GET /health should return OK
rspec ./spec/request/health_spec.rb:12 # Health endpoint GET /health should return status code 200

Gracias por su ayuda

0
HernieP
HernieP
Estudiante

Soy yo o el archivo posts_spec.rb esta distinto al que habiamos creado anteriormente o,o?

0