Web Services with Ruby on Rails - 91-514-s2011 - home

gayheadtibburInternet και Εφαρμογές Web

5 Φεβ 2013 (πριν από 4 χρόνια και 6 μήνες)

132 εμφανίσεις

Creating Web Services with Ruby
on Rails

Robert Thew

Internet and Web Systems II

What is Ruby?


Ruby is a language created in Japan in 1995 by
Yukihiro Matsumoto


It

s an Object
-
Oriented language that also has
elements of Functional languages


Matsumoto wanted to create a language that
combined all his favorite features into one
language

Basics of Ruby


Ruby on Rails


A Model
-
View
-
Controller Web Framework for
Ruby developed in 2004 by David
Heinemeier

Hansson


Guiding principle is Convention over
Configuration


Very little boilerplate code


Small classes with short methods


Allows for rapid development

Installation


Ruby and
RoR

come installed on
MacPros


Can be downloaded and installed from:


r
uby
-
lang.org


rubyonrails.org


MySQL can be downloaded from
mysql.com

Building an Application


Run the rails command
to create a new
application framework


Go into the new
directory and edit the
database
config

file


Add user and password
for development entry


$
rails new
biblio


$cd
bilblio


$vi
config
/
database.yml

Create Database


Create an empty
development database
instance

$rake
db:create

Test Application



Add Model



Generate Controller



Generate Views



Run Application



Add Data



View Data