$30 off During Our Annual Pro Sale. View Details »
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
Deno Tunnel を使ってみた話
kamekyame
0
220
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
130
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.5k
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
120
Microservices rules: What good looks like
cer
PRO
0
1.6k
AIコーディングエージェント(Gemini)
kondai24
0
260
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
310
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.9k
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
Developing static sites with Ruby
okuramasafumi
0
320
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
250
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
260
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
400
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
680
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
0
41
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
29
The agentic SEO stack - context over prompts
schlessera
0
550
Leadership Guide Workshop - DevTernity 2021
reverentgeek
0
160
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.8k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
32
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
400
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