Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Nos trilhos do Ruby
Search
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
44
Nest Framework
danielcdesouza
0
110
"Go" da Alemanha! Sete passos para começar a desenvolver em Go
danielcdesouza
0
78
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
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
190
React Native New Architecture 移行実践報告
taminif
1
160
関数実行の裏側では何が起きているのか?
minop1205
1
700
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
3
740
開発に寄りそう自動テストの実現
goyoki
2
1k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
310
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
490
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.9k
TestingOsaka6_Ozono
o3
0
160
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
310
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
170
Cap'n Webについて
yusukebe
0
130
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Embracing the Ebb and Flow
colly
88
4.9k
Mobile First: as difficult as doing things right
swwweet
225
10k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Writing Fast Ruby
sferik
630
62k
Docker and Python
trallard
47
3.7k
A designer walks into a library…
pauljervisheath
210
24k
RailsConf 2023
tenderlove
30
1.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
The World Runs on Bad Software
bkeepers
PRO
72
12k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
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