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
Nos trilhos do Ruby
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Daniel Cavalcante
February 03, 2016
Programming
0
57
Nos trilhos do Ruby
Palestra ministrada na XIV semana da computação da UFPB.
Daniel Cavalcante
February 03, 2016
Tweet
Share
More Decks by Daniel Cavalcante
See All by Daniel Cavalcante
Arquiteturas modulares com Node.JS
danielcdesouza
1
58
React Native e GraphQL na construção de mobile apps
danielcdesouza
0
45
Nest Framework
danielcdesouza
0
110
"Go" da Alemanha! Sete passos para começar a desenvolver em Go
danielcdesouza
0
79
Novidades do Ruby on Rails 5
danielcdesouza
0
60
Minerando jóias: como extrair o melhor do Ruby
danielcdesouza
0
55
Conhecendo o AngularJS
danielcdesouza
1
87
Começando com Ruby on Rails
danielcdesouza
0
96
Apresentação sobre Framework VRaptor
danielcdesouza
0
130
Other Decks in Programming
See All in Programming
今から始めるClaude Code超入門
448jp
8
8.6k
CSC307 Lecture 09
javiergs
PRO
1
830
Patterns of Patterns
denyspoltorak
0
1.4k
CSC307 Lecture 05
javiergs
PRO
0
500
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
110
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
Game over? The fight for quality and originality in the time of robots
wayneb77
1
110
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
Building Applications with DynamoDB
mza
96
6.9k
Believing is Seeing
oripsolob
1
54
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Rails Girls Zürich Keynote
gr2m
96
14k
Exploring anti-patterns in Rails
aemeredith
2
250
Transcript
Nos trilhos do Ruby @danielcdesouza
Daniel Cavalcante
None
None
Rails?
! Framework Web Criado em 2003
David Heinemeier Hansson
" Ruby Linguagem de programação
# MVC Arquitetura
$ Don’t Repeat Yourself Não se repita (DRY)
% REST Organizar sua aplicação com recursos e verbos HTTP
& Convention over Configuration Framework baseado em convenções
Componentes
' Action Controller
/my_app ../app ../controllers ../books_controllers.rb controllers
class BooksController < ApplicationController def index @books = Book.all end
def show @book = Book.find(params[:id]) end end books_controller.rb
# Action View
/my_app ../app ../controllers ../books_controllers.rb ../views ../books ../index.html.erb ../show.html.erb views
<h2>My books</h2> <% @books.each do |book| %> <%= book.title %>
<%= book.author %> <% end %> index.html.erb
Active Record
class Book < ActiveRecord::Base validates_presence_of :title, :author, :user end book.rb
class BooksController < ApplicationController def index @books = Book.all end
def show @book = Book.find(params[:id]) end end books_controller.rb
# Active Resource
routes Rails.application.routes.draw do get ‘/books’ => ‘books#index’ get ‘/book’ =>
‘books#show’ end
routes Rails.application.routes.draw do resources :books end
•Action Controller •Action View •Active Record •Active Resource •Action Mailer
•Railties •Active Support outros componentes …
instalação Instale o Ruby on Rails $ gem install rails
criando o app Criando seu primeiro projeto $ rails new
my_app
arquivos gerados pelo Rails
gemfile source ‘https://rubygems.org' gem 'rails', '4.2.3' gem 'pg' gem 'sass-rails',
'~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.1.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0’ gem 'sdoc', '~> 0.4.0', group: :doc group :development, :test do gem 'byebug' gem 'web-console', '~> 2.0' end
gems Baixar gems $ bundle install
servidor Inicie o servidor $ rails server
acesse localmente Acesse a página da aplicação http://localhost:3000
Outros diferenciais
Jampa Ruby
) Obrigado *@danielcdesouza