Ruby and Rails An Introduction: Karthiksr@cse - Iitb.ac - in
Ruby and Rails An Introduction: Karthiksr@cse - Iitb.ac - in
An Introduction
[email protected]
Agenda
The language – Ruby
The framework – Ruby On Rails
Demo
Resources
Questions
Ruby
SmallTalk
Lisp
RUBY Perl
Eiffel
Java
Ruby
Dynamic, Interpreted
Object oriented (True)
Scripting, RegExp
Platform independent
Lots of library support
Idioms
Principle of least surprise
Principle of succinctness
Principle of least effort
Convention
Extensible
Examples
def initialize(l,b)
@length = l
@breadth = b
end
def area
@length * @breadth
end
def perimeter
2*(@length + @breadth)
end
end
Examples
rectangle = Rectangle.new(10,5)
puts rectangle.area
# prints 50
puts rectangle.perimeter
# prints 30
Rails in a nutshell
Web development that doesn't hurt
Open source web framework built in Ruby
Includes everything needed to create web apps
according to the Model-View-Control pattern
Opinionated software(!)