El camino a la felicidad
con Ruby on Rails
Barcamp Valencia
http://spainrb.org/felipe-talavera
http://spainrb.org/felipe-talavera
is an open-source framework that's optimized for programmer happiness and sustainable productivity.
It lets you write beautiful code by favoring convention over configuration.
is a dynamic, open source programming language with a focus on simplicity and productivity.
It has an elegant syntax that is natural to read and easy to write.
Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto.
It is based on Perl, Smalltalk, Eiffel, Ada, and Lisp.
Make the computer work for you.
Design the language and libraries for people first
happiness = "I am happy :)"
puts happiness
happiness = "I am happy :)"
3.times { puts happiness }
=> "I am happy :)"
=> "I am happy :)"
=> "I am happy :)"
Rails was created in 2003 by David Heinemeier Hansson and has since been extended by the Rails core team, more than 1,400 contributors, and supported by a vibrant ecosystem.
“Ruby on Rails is a breakthrough in lowering the barriers of entry to programming. Powerful web applications that formerly might have taken weeks or months to develop can be produced in a matter of days.”
-Tim O'Reilly, Founder of O'Reilly Media

Los tres componentes son:
class Car < ActiveRecord::Base
belongs_to :owner
has_many :wheels
has_one :engine
validates_presence_of :driver
def serial_number
"KEOD EDPE SKDL"
end
end
class CarsController < ApplicationController
# GET /cars
# GET /cars.xml
def index
@cars = Car.all
respond_to do |fo rmat|
format.html # index.html.erb
format.xml { render :xml => @shops }
end
end
# GET /cars/1
# GET /cars/1.xml
def show
@car = Car.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @shop }
end
end
end
<h1>Listing Cars</h1>
<table>
<tr>
</tr>
<% @cars.each do |car| %>
<tr>
<td><%= link_to 'Show', cars %></td>
<td><%= link_to 'Edit', edit_cars_path(car) %></td>
<td><%= link_to 'Destroy', cars, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Car', new_car_path %>
Ahora Rails 2.3.3 vamos hacia...
¿Tenemos tiempo?
https://github.com/flype/barcamp_valencia/tree