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
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
CSC307 Lecture 05
javiergs
PRO
0
500
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
Oxlintはいいぞ
yug1224
5
1.3k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
530
CSC307 Lecture 04
javiergs
PRO
0
660
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
160
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
260
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
AI時代の認知負荷との向き合い方
optfit
0
150
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
Between Models and Reality
mayunak
1
180
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
110
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
How to make the Groovebox
asonas
2
1.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Chasing Engaging Ingredients in Design
codingconduct
0
110
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
Become a Pro
speakerdeck
PRO
31
5.8k
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