Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Initiation à Ruby on Rails
Search
Matthieu Segret
February 12, 2013
Programming
140
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Initiation à Ruby on Rails
Matthieu Segret
February 12, 2013
More Decks by Matthieu Segret
See All by Matthieu Segret
Initiation à Gosu
matthieusegret
0
66
Other Decks in Programming
See All in Programming
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
sbt 2.0: takeoff
eed3si9n
0
150
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
230
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
気持ちぃ〜角丸 Squircle
ryu1013
0
300
SREの越境 / SRE Collaboration
y0hgi
2
310
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
130
Railsバージョンを4倍にした話
optim
0
280
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.4k
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1k
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
620
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
A better future with KSS
kneath
240
18k
WCS-LA-2024
lcolladotor
0
890
Between Models and Reality
mayunak
4
500
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
Designing for Timeless Needs
cassininazir
1
520
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Transcript
Initiation à Ruby on Rails @humancoders
@matthieusegret
Matthieu Segret Formateur Ruby on Rails Cofondateur de Human Coders
Un langage : Ruby
• Langage interprété / orienté objet • Libre - Licence
Ruby et GPL • Version 1.9.3 (bientôt 2.0) • Apparu en 1995 Ruby
None
None
puts "Hello world" Ruby "ruby is cool".length # 12 -42.abs
# 42 "Nice Day Isn't It?".downcase.split # ["nice", "day", "isn't", "it?"]
class Book def initialize(name) @name = name end def name
@name end end Ruby book = Book.new("Programming Ruby") book.name # "Programming Ruby"
None
None
Un framework : Ruby on Rails
• Framework web écrit en Ruby • Libre - MIT
• Version 3.2 (bientôt 4.0) • Apparu en 2004 Ruby on Rails
Convention over Configuration
DRY (Don’t Repeat Yourself)
Projet : MyNotes
Projet : MyNotes $ rails new MyNotes • Créer un
nouveau projet $ cd MyNotes $ rails server • Démarrer le serveur
None
View Controller Model Routing
None
CRUD
Create Read Update Delete CRUD
Ressource : notes notes notes id integer title varchar content
text
$ rails generate scaffold note title content:text invoke active_record create
db/migrate/20130130171611_create_notes.rb create app/models/note.rb invoke test_unit create test/unit/note_test.rb create test/fixtures/notes.yml invoke resource_route route resources :notes invoke scaffold_controller create app/controllers/notes_controller.rb invoke erb create app/views/notes create app/views/notes/index.html.erb create app/views/notes/edit.html.erb create app/views/notes/show.html.erb create app/views/notes/new.html.erb create app/views/notes/_form.html.erb ... Génération du CRUD
Migration
migration 1 migration 2 migration 3 migration 4 Migration
devise_create_users acts_as_follower create_notes add_profile_to_user 20110720095338_ 20110718190746_ 20110715205012_ 20110605152153_ rake db:migrate
rake db:rollback current .rb Migration
Migration class CreateNotes < ActiveRecord::Migration def change create_table :notes do
|t| t.string :title t.text :content t.timestamps end end end db/migrate/20130130175117_create_notes.rb $ rake db:migrate
Base de données notes notes id integer title varchar content
text
None
Modèle
View Controller Model Routing
Modèle class Note < ActiveRecord::Base end app/models/note.rb
Modèle : création Note.create(content: "I created Ruby", title: "Matz")
Modèle : mise à jour note = Note.find(1) note.content =
"I love Ruby" note.save
Modèle : lecture Note.where(:title => "Matz").order("title ASC").limit(5)
Modèle : suppression Note.find(1).destroy
Vue
View Controller Model Routing
ERB <p> <b>Title:</b> <%= @note.title %> </p> <p> <b>Content:</b> <%=
@note.content %> </p> app/views/notes/show.html.erb
Formulaires <%= form_for(@note) do |f| %> <%= f.label :title %>
<%= f.text_field :title %> <%= f.label :content %> <%= f.text_area :content %> <%= f.submit %> <% end %>
Contrôleur
View Controller Model Routing
Contrôleur class NotesController < ApplicationController def show @note = Note.find(params[:id])
end end app/controllers/notes_controller.rb app/views/notes/show.html.erb Request GET /notes/1 <p> <b>Title:</b> <%= @note.title %> </p>
Déploiement
None
Les gems
Indexation Twitter NoSQL Paiement en ligne Géolocalisation Parsing Pagination Cache
Tâches de fonds Upload de fichiers Facebook Authentification Localisation OAuth A/B teste LDAP
La commautée Française
Montpellier Lyon Toulouse Nantes Rennes Lille Paris Sophia Antipolis Strasbourg
Marseille Compiegne Bordeaux
Aller plus loin
None
Programming Ruby 1.9 (3rd edition) Agile Web Development with Rails
(4th edition)
None
Formation
@humancoders Merci !