Build a Web Application with Ruby on Rails Framework - Software School (2024-07-27)

  Рет қаралды 68

Tech World Software School

Tech World Software School

Күн бұрын

This lecture is a brief introduction to the Ruby on Rails framework to build a web server.
The Ruby programming language is used to write the code for a Rails application.
You can install Ruby from www.ruby-lang.org. You can type ruby -v in the terminal to see if it is installed.
Third-party packages in Ruby are called gems. And you can install them by calling the gem command. The lecture shows you how to install rails using RubyGems.
With the Rails command, you can then generate a new project. All the file structure will be generated for you.
Ruby on Rails follows convention over configuration (COC), meaning you have to following the set of rules laid out by the framework and everything will just work seamlessly out of the box.
The lecture shows you how to power up a Rails server. If you are on Windows (not WSL), you have to prefix the bin/rails command with ruby.
Ruby on Rails follows the Model-View-Controller (MVC) paradigm.
You learn to use the Rails command to create a controller and a view.
Then you learn about models.
Along the way you are introduced to SQLite that is used as the default database for the Rails app. You can always change that to another kind of database, though.
You learn how to access the Rails DB console. And you learn about the graphical user interface for SQLite called DB Browser for SQLite.
You also learn how to access the Rails console to run Ruby code and leverage the object-relational mapper (ORM) ActiveRecord.
You learn to show a list of products in the index page by using Embedded Ruby.
You learn to make a new page and defining the route, controller action, and the view.
You learn how to build a form using form helpers. Although you can always write HTML manually, Rails provides some helper functions that generate HTML code conveniently by just calling them.
You learn to define an HTTP POST endpoint that is used to create a product. You learn to define the controller action, taking the information submitted by the user via params, permitting the params, and finally using ActiveRecord to ultimately create the record in the database.
Source Code: github.com/nbk...

Пікірлер: 2
Nea: A webserver that never allocates - Folkert de Vries
37:49
Zig SHOWTIME
Рет қаралды 5 М.
The Ruby On Rails Junior Developer Problem
16:03
Deanin
Рет қаралды 19 М.
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 15 МЛН
Dad gives best memory keeper
01:00
Justin Flom
Рет қаралды 20 МЛН
Ruby on Rails in 100 Seconds
3:33
Fireship
Рет қаралды 441 М.
Intro to Golang (Building a JSON API) - Software School (2024-08-24)
55:37
Tech World Software School
Рет қаралды 130
Weather Observation Station 15 | SQL Aggregation | HackerRank Solution
3:19
Tech World Software School
Рет қаралды 282
40 Years Of Software Engineering Experience In 19 Minutes
19:10
Continuous Delivery
Рет қаралды 51 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 156 М.
"The Life & Death of htmx" by Alexander Petros at Big Sky Dev Con 2024
23:01
Montana Programmers
Рет қаралды 56 М.
If Your Code Looks Like This... You're A GOOD Programmer
16:39
Continuous Delivery
Рет қаралды 67 М.
When RESTful architecture isn't enough...
21:02
Dreams of Code
Рет қаралды 275 М.
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 15 МЛН