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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Daniel Cavalcante
February 03, 2016
Programming
61
0
Share
Nos trilhos do Ruby
Palestra ministrada na XIV semana da computação da UFPB.
Daniel Cavalcante
February 03, 2016
More Decks by Daniel Cavalcante
See All by Daniel Cavalcante
Arquiteturas modulares com Node.JS
danielcdesouza
1
75
React Native e GraphQL na construção de mobile apps
danielcdesouza
0
54
Nest Framework
danielcdesouza
0
120
"Go" da Alemanha! Sete passos para começar a desenvolver em Go
danielcdesouza
0
90
Novidades do Ruby on Rails 5
danielcdesouza
0
63
Minerando jóias: como extrair o melhor do Ruby
danielcdesouza
0
57
Conhecendo o AngularJS
danielcdesouza
1
90
Começando com Ruby on Rails
danielcdesouza
0
99
Apresentação sobre Framework VRaptor
danielcdesouza
0
140
Other Decks in Programming
See All in Programming
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3k
さぁV100、メモリをお食べ・・・
nilpe
0
120
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.5k
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
130
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
110
Claspは野良GASの夢をみるか
takter00
0
150
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
110
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
320
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
770
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
13
4.6k
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.4k
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
Paper Plane
katiecoart
PRO
1
51k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
130
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
560
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
130
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
420
Typedesign – Prime Four
hannesfritz
42
3.1k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
380
A better future with KSS
kneath
240
18k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
22k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
470
Optimising Largest Contentful Paint
csswizardry
37
3.7k
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