Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rubinai ant bėgių
Search
Domas Bitvinskas
November 30, 2013
Programming
1
1.1k
Rubinai ant bėgių
A brief sweet intro into Ruby on Rails.
Domas Bitvinskas
November 30, 2013
Tweet
Share
More Decks by Domas Bitvinskas
See All by Domas Bitvinskas
3 cool AI things
nedomas
0
320
Apollo & GraphQL: What we learned building a multi-platform chat app
nedomas
1
260
Best kept secrets for 2019: GraphQL + Prisma
nedomas
1
75
Tensorflow.js ir web ateitis
nedomas
1
150
Hack the Open Source Growth
nedomas
1
110
Market your Open Source or kill it
nedomas
1
940
Ruby on Rails is dead
nedomas
2
1.2k
Why does Ruby own the startup world?
nedomas
0
670
Rockstars and Productivity
nedomas
1
960
Other Decks in Programming
See All in Programming
PHPのガベージコレクションを深掘りしよう
rinchoku
0
230
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
0
190
令和トラベルにおけるコンテンツ生成AIアプリケーション開発の実践
ippo012
1
250
リアクティブシステムの変遷から理解するalien-signals / Learning alien-signals from the evolution of reactive systems
yamanoku
1
170
snacks.nvim内のセットアップ不要なプラグインを紹介 / introduce_snacks_nvim
uhooi
0
300
ベクトル検索システムの気持ち
monochromegane
28
7.7k
OUPC2024 Day 1 解説
kowerkoint
0
380
Go1.24で testing.B.Loopが爆誕
kuro_kurorrr
0
140
Scala 3 で GLSL のための c-like-for を実装してみた
exoego
1
170
本当だってば!俺もTRICK 2022に入賞してたんだってば!
jinroq
0
180
Identifying and Analyzing Fake OSS with Malware - fukuoka.go#21
rhykw
0
520
WordPress Playground for Developers
iambherulal
0
120
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
91
5.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
320
The Pragmatic Product Professional
lauravandoore
33
6.5k
Music & Morning Musume
bryan
46
6.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Code Review Best Practice
trishagee
67
18k
Documentation Writing (for coders)
carmenintech
69
4.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
YesSQL, Process and Tooling at Scale
rocio
172
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
Facilitating Awesome Meetings
lara
53
6.3k
Transcript
Rubinai ant bėgių
DOMAS BITVINSKAS domasbitvinskas.com @Nedomas
kodėl?
None
None
None
<HTML>
! ! ! ! ! <h1>F-18 jet fighter with Ruby</h1>
<html> <head> <title>Talks</title> </head> <body> <h1>F-18 jet fighter with Ruby</h1>
</body> </html>
! <h1>The Kids Aren’t Alright on TODAY</h1>
<h1>The Kids Aren’t Alright on TODAY</h1> ! ! ! <h1>The
Kids Aren’t Alright on 2013-11-30</h1> PROGRAMA, GENERUOJANTI HTML
<h1>The Kids Aren’t Alright on TODAY</h1> ! ! ! <h1>The
Kids Aren’t Alright on 2013-11-30</h1> SERVERIS
Ruby Rails HTML karkasas
konfigūracija
struktūra app bin config lib log public test
struktūra app bin config lib log public test
struktūra app … models views controllers bin config
struktūra app … models views controllers bin config M V
C
None
Controller View Model
http://todoapp.com /todos SERVERIS PUSLAPIS
PUSLAPIS /todos todos/index.html.erb Todo TodosController View Model Controller index Veiksmas
PUSLAPIS /todos/index todos/index.html.erb Todo TodosController View Model Controller index Veiksmas
None
None
None
None
None
rails new server
rails new server generate
rails generate scaffold Todo name:string on_date:date done:boolean
rake db:migrate
None
None
None
None
None
! <h1>Listing todos</h1> … <tr> <td>Launch the spaceship</td> <td>2015-07-24</td> …
</tr> … HTML
app/views/index.html.erb <h1>Listing todos</h1> <% @todos.each do |todo| %> <tr> <td><%=
todo.name %></td> <td><%= todo.on_date %></td> … </tr> <% end %> … RUBY/ERB
app/controllers/todos_controller.rb class TodosController … def index @todos = Todo.all end
… end RUBY
Užduotis
Sugeneruokite aplikaciją ingredientams. Ingredientas turės: • pavadinimą - name •
kainą - price • galiojimo datą - good_till • suvalgytas - eaten ! Pavyzdys: rails new todo_app cd todo_app rails server rails generate scaffold Todo name:string on_date:date done:boolean rake db:migrate TIPAI: string, float, integer, date, datetime, boolean