SlideShare ist ein Scribd-Unternehmen logo
1 von 37
RUBY
ON
RAILS
AN INTRODUCTION…
Some general things:
o Ruby is the programming language.
o Rails is a Web Development
Framework on top of Ruby.
ABOUT RUBY
Ruby is:
o Dynamic – executes on runtime.
o Reflective – modifies itself on runtime.
o General purpose – can be used for any
programming purpose.
oOpen Source…
o Object oriented…
o High-Level…
THE RUBY STORY
Developed in the early-1990s.
Created by Yukihiro "Matz" Matsumoto.
Originates from Japan.
First released on February 1995.
Next major release, Ruby 2.0
expected on 2013.
TECHNICAL INFO
Interprets to C.
Uses the best practices from Perl, Smalltalk, Eiffel, and Lisp.
Ruby follows the principle of least astonishment (POLA).
Works as expected.
Alternative implementations of
Ruby, including YARV, JRuby, Rubinius, IronRuby,
MacRuby, and HotRuby.
INSTALLING RUBY
Depending on tour system there are
many different installation ways.
The 3 basic Ways are:
1. You can compile it from source.
2. You can install it through 3rd party
tools, RVM – Linux/MacOS,
Ruby Installer – Windows.
3. Via package managers:
Apt-get install, yum install,
brew install, pacman –S etc.
FILE EXTENSIONS
The most popular file extensions of Ruby (and also
Rails) files are:
o .rb the Ruby class files.
o .gem Ruby package files that may contain
Ruby programs and libraries.
o .yml data mapping files.
o .html.erb Ruby html files.
DO YOU SPEAK RUBY?
Ruby is a scripting language, which has one
goal:
To be programmer friendly.
So it's expressive, and closer to physical
language.
SOME RUBY TALK
Something no one ever seen before…
Let’s do an innovative Hello World example:
puts "Hello World!"
RUBY LOGIC
In Ruby Everything is an object. There are no
primitive types. Lines and | are code seperators.
No need to declare variable types. For exampe:
@name #a variable
@name = 2 #a number
@name = “Kaiser Chiefs” #a String
@name = 1..52 #a range
@name = [“Rails”,12,[6,7,9],3..53]
#a collection
RUBY LOGIC AGAIN
A class example
class Person
attr_accessor :name
end
Class instance Example
bob = Person.new
bob.name = “Bob the Builder”
Blocks example – blocks are anonymous functions
workers = [Bob, Maria, George, Sylvia]
for person in workers do
puts person.name
end
workers.each do |person|
puts person.name
end
RUBY LOGIC AGAIN AND AGAIN
Iterrators example
best_workers = workers.select{|person|
person.name.include? ”a”}
Hashes are a great way to store things:
Hash example
fav_djs = {“tiesto” => 8, “deadmau5” => 6,
“kaskade” => 3, “benassi” => 7}
fav_djs[“deadmau5”] >> 6
fav_djs[“benassi”]+=2 >> 9
fav_djs[“afrojack”] = 5
HOW TO HACK SOMETHING USING RUBY…
Now we know enough to…
SO? WHAT’S RAILS?
•Open source
• MVC Web Framework
•Optimized for programmer happiness.
•Developed for database backed
web applications,.
•Very AGILE
FOR STARTERS
Rails is a ruby web framework.
It was designed by David Heinemeier Hansson.
Was released as an open source project on 2004.
And joined Mac on 2007.
MVC ON RAILS
SOMETIMES PICTURES AREN’T ENOUGH
• This pattern splits the view (also called the presentation) in
"dumb" templates that are primarily responsible for inserting
pre-built data in between HTML tags.
• The model contains the "smart" domain objects (such as
Account, Product, Person, Post) that holds all the business
logic and knows how to persist themselves to a database.
• The controller handles the incoming
requests (such as Save New Account,
Update Product, Show Post) by
manipulating the model and directing
data to the view.
RAILS FIGHTS FOR
Write Less Do More.
DRY – Don’t Repeat Yourself.
COC – Convention over Configuration.
REST- Representational State
Transfer.
HOW EASY IS TO LEARN RAILS?
RAILS CAPABILITIES
•ORM : Object Relational Mapping.
•CRUD: Create Read Update Delete
a Database.
•Both BDD and TDD: Behavior and Test Driven
Development.
•Ajax and Web Services.
•Meta Programming.
WHAT IS ORM?
Active Record (ORM)
An ORM layer built-in maps classes to tables so :
•Every row is an object.
•Every column is an object attribute.
Also it uses conventions to minimize
configuration.
COMPATIBILITY
Most Platforms :
Linux, Windows, MacOs etc.
Most Databases :
MySQL, Sqlite, NoSQL etc.
A lot of Web Servers :
Nginx, Apache, Passenger etc.
RAILS VS JAVA AND PHP
GETTING STARTED
All Rails Apps use the same
structure.
No matter the editor or IDE you
are using, the projects have
the same build.
The newer versions always
support the older.
RAILS 3.0 PROJECT STRUCTURE
DEVELOPER TOOLS
Editors: vim, gedit, Textmate
and more
IDEs: RubyMine, Eclipse with
plugin, Aptana, Radrails, 3rdR
ail
GETTING STARTED
Installation, 3 steps:
1. Open your terminal, no
matter the OS you are
using.
2. Type:
gem install rails
3. Press enter, sit back and
enjoy.
BUILD YOUR FIRST APP
1. Open your terminal and cd
to the folder where you
want to place your project .
2. Type & enter:
rails new Project_Name
3. Type & enter:
rails s
4. Visit your localhost:3000,
from your browser
5. You can see your first rails
app running
BUILD YOUR FIRST APP
This is what you would see…
FAMOUS WEBSITES ON RAILS
FAMOUS WEBSITES ON RAILS
FAMOUS WEBSITES ON RAILS
FAMOUS WEBSITES ON RAILS
USEFUL LINKS
• http://rubyonrails.org/
• http://railsforzombies.org/
• http://ruby.railstutorial.org/
• http://www.aptana.com/products/radrails
• http://railscasts.com/
• http://www.ruby-forum.com/forum/rails
• http://www.google.gr/
AND SOME PERSONAL TIPS
Don’t be afraid to search and try, it pays… a lot.
THANK YOU !!!
Don’t worry guys,
Just gotta practice !!!!

Weitere ähnliche Inhalte

Was ist angesagt?

MongoDB EuroPython 2009
MongoDB EuroPython 2009MongoDB EuroPython 2009
MongoDB EuroPython 2009Mike Dirolf
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJSTim Sommer
 
JavaScript History
JavaScript HistoryJavaScript History
JavaScript HistoryRhio Kim
 
JRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyJRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyEvgeny Rahman
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Jukka Zitting
 
Databases which, why and usage tips
Databases which, why and usage tipsDatabases which, why and usage tips
Databases which, why and usage tipsavnerner
 
Octocatは技術的負債の夢を見るか?
Octocatは技術的負債の夢を見るか?Octocatは技術的負債の夢を見るか?
Octocatは技術的負債の夢を見るか?treby
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesLogeekNightUkraine
 
MongoDB Strange Loop 2009
MongoDB Strange Loop 2009MongoDB Strange Loop 2009
MongoDB Strange Loop 2009Mike Dirolf
 
callSuper in kissy
callSuper in kissycallSuper in kissy
callSuper in kissyyiming he
 
Content Management With Apache Jackrabbit
Content Management With Apache JackrabbitContent Management With Apache Jackrabbit
Content Management With Apache JackrabbitJukka Zitting
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisRicard Clau
 
Java Programming Important Topics
Java Programming Important Topics Java Programming Important Topics
Java Programming Important Topics SANJAYMANVATKAR1
 

Was ist angesagt? (15)

MongoDB EuroPython 2009
MongoDB EuroPython 2009MongoDB EuroPython 2009
MongoDB EuroPython 2009
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
 
JavaScript History
JavaScript HistoryJavaScript History
JavaScript History
 
Qtp
QtpQtp
Qtp
 
JRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyJRuby - The Best of Java and Ruby
JRuby - The Best of Java and Ruby
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
 
Databases which, why and usage tips
Databases which, why and usage tipsDatabases which, why and usage tips
Databases which, why and usage tips
 
Octocatは技術的負債の夢を見るか?
Octocatは技術的負債の夢を見るか?Octocatは技術的負債の夢を見るか?
Octocatは技術的負債の夢を見るか?
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script Technologies
 
MongoDB Strange Loop 2009
MongoDB Strange Loop 2009MongoDB Strange Loop 2009
MongoDB Strange Loop 2009
 
2 Basics
2 Basics2 Basics
2 Basics
 
callSuper in kissy
callSuper in kissycallSuper in kissy
callSuper in kissy
 
Content Management With Apache Jackrabbit
Content Management With Apache JackrabbitContent Management With Apache Jackrabbit
Content Management With Apache Jackrabbit
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with Redis
 
Java Programming Important Topics
Java Programming Important Topics Java Programming Important Topics
Java Programming Important Topics
 

Andere mochten auch

Intro to Rails and MVC
Intro to Rails and MVCIntro to Rails and MVC
Intro to Rails and MVCSarah Allen
 
Никита Корчагин - iOS development information
Никита Корчагин - iOS development informationНикита Корчагин - iOS development information
Никита Корчагин - iOS development informationDataArt
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsDiki Andeas
 
Module 21 investigative reports
Module 21 investigative reportsModule 21 investigative reports
Module 21 investigative reportssagaroceanic11
 

Andere mochten auch (6)

Intro To Swift
Intro To SwiftIntro To Swift
Intro To Swift
 
Introduction to Rails
Introduction to RailsIntroduction to Rails
Introduction to Rails
 
Intro to Rails and MVC
Intro to Rails and MVCIntro to Rails and MVC
Intro to Rails and MVC
 
Никита Корчагин - iOS development information
Никита Корчагин - iOS development informationНикита Корчагин - iOS development information
Никита Корчагин - iOS development information
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Module 21 investigative reports
Module 21 investigative reportsModule 21 investigative reports
Module 21 investigative reports
 

Ähnlich wie Rubyonrails 120409061835-phpapp02

Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overviewThomas Asikis
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First MileGourab Mitra
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3Blazing Cloud
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingDan Davis
 
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman OrtegaIntroduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortegaarman o
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Mark Menard
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyNick Sieger
 
Ruby Presentation
Ruby Presentation Ruby Presentation
Ruby Presentation platico_dev
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction Tran Hung
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
Ruby On Rails - Rochester K Linux User Group
Ruby On Rails - Rochester K Linux User GroupRuby On Rails - Rochester K Linux User Group
Ruby On Rails - Rochester K Linux User GroupJose de Leon
 

Ähnlich wie Rubyonrails 120409061835-phpapp02 (20)

Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Ruby on Rails
Ruby on Rails Ruby on Rails
Ruby on Rails
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
 
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman OrtegaIntroduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortega
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
 
FGCU Camp Talk
FGCU Camp TalkFGCU Camp Talk
FGCU Camp Talk
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
Ruby Presentation
Ruby Presentation Ruby Presentation
Ruby Presentation
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
ruby pentest
ruby pentestruby pentest
ruby pentest
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Ruby On Rails - Rochester K Linux User Group
Ruby On Rails - Rochester K Linux User GroupRuby On Rails - Rochester K Linux User Group
Ruby On Rails - Rochester K Linux User Group
 

Mehr von sagaroceanic11

Module 20 mobile forensics
Module 20 mobile forensicsModule 20 mobile forensics
Module 20 mobile forensicssagaroceanic11
 
Module 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimesModule 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimessagaroceanic11
 
Module 18 investigating web attacks
Module 18 investigating web attacksModule 18 investigating web attacks
Module 18 investigating web attackssagaroceanic11
 
Module 17 investigating wireless attacks
Module 17 investigating wireless attacksModule 17 investigating wireless attacks
Module 17 investigating wireless attackssagaroceanic11
 
Module 04 digital evidence
Module 04 digital evidenceModule 04 digital evidence
Module 04 digital evidencesagaroceanic11
 
Module 03 searching and seizing computers
Module 03 searching and seizing computersModule 03 searching and seizing computers
Module 03 searching and seizing computerssagaroceanic11
 
Module 01 computer forensics in todays world
Module 01 computer forensics in todays worldModule 01 computer forensics in todays world
Module 01 computer forensics in todays worldsagaroceanic11
 
Virtualisation with v mware
Virtualisation with v mwareVirtualisation with v mware
Virtualisation with v mwaresagaroceanic11
 
Virtualisation overview
Virtualisation overviewVirtualisation overview
Virtualisation overviewsagaroceanic11
 
Introduction to virtualisation
Introduction to virtualisationIntroduction to virtualisation
Introduction to virtualisationsagaroceanic11
 
2 the service lifecycle
2 the service lifecycle2 the service lifecycle
2 the service lifecyclesagaroceanic11
 
1 introduction to itil v[1].3
1 introduction to itil v[1].31 introduction to itil v[1].3
1 introduction to itil v[1].3sagaroceanic11
 
Visual studio 2008 overview
Visual studio 2008 overviewVisual studio 2008 overview
Visual studio 2008 overviewsagaroceanic11
 

Mehr von sagaroceanic11 (20)

Module 20 mobile forensics
Module 20 mobile forensicsModule 20 mobile forensics
Module 20 mobile forensics
 
Module 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimesModule 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimes
 
Module 18 investigating web attacks
Module 18 investigating web attacksModule 18 investigating web attacks
Module 18 investigating web attacks
 
Module 17 investigating wireless attacks
Module 17 investigating wireless attacksModule 17 investigating wireless attacks
Module 17 investigating wireless attacks
 
Module 04 digital evidence
Module 04 digital evidenceModule 04 digital evidence
Module 04 digital evidence
 
Module 03 searching and seizing computers
Module 03 searching and seizing computersModule 03 searching and seizing computers
Module 03 searching and seizing computers
 
Module 01 computer forensics in todays world
Module 01 computer forensics in todays worldModule 01 computer forensics in todays world
Module 01 computer forensics in todays world
 
Virtualisation with v mware
Virtualisation with v mwareVirtualisation with v mware
Virtualisation with v mware
 
Virtualisation overview
Virtualisation overviewVirtualisation overview
Virtualisation overview
 
Virtualisation basics
Virtualisation basicsVirtualisation basics
Virtualisation basics
 
Introduction to virtualisation
Introduction to virtualisationIntroduction to virtualisation
Introduction to virtualisation
 
6 service operation
6 service operation6 service operation
6 service operation
 
5 service transition
5 service transition5 service transition
5 service transition
 
4 service design
4 service design4 service design
4 service design
 
3 service strategy
3 service strategy3 service strategy
3 service strategy
 
2 the service lifecycle
2 the service lifecycle2 the service lifecycle
2 the service lifecycle
 
1 introduction to itil v[1].3
1 introduction to itil v[1].31 introduction to itil v[1].3
1 introduction to itil v[1].3
 
Visual studio 2008 overview
Visual studio 2008 overviewVisual studio 2008 overview
Visual studio 2008 overview
 
Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
 
Vb essentials
Vb essentialsVb essentials
Vb essentials
 

Rubyonrails 120409061835-phpapp02

  • 2. AN INTRODUCTION… Some general things: o Ruby is the programming language. o Rails is a Web Development Framework on top of Ruby.
  • 3. ABOUT RUBY Ruby is: o Dynamic – executes on runtime. o Reflective – modifies itself on runtime. o General purpose – can be used for any programming purpose. oOpen Source… o Object oriented… o High-Level…
  • 4. THE RUBY STORY Developed in the early-1990s. Created by Yukihiro "Matz" Matsumoto. Originates from Japan. First released on February 1995. Next major release, Ruby 2.0 expected on 2013.
  • 5. TECHNICAL INFO Interprets to C. Uses the best practices from Perl, Smalltalk, Eiffel, and Lisp. Ruby follows the principle of least astonishment (POLA). Works as expected. Alternative implementations of Ruby, including YARV, JRuby, Rubinius, IronRuby, MacRuby, and HotRuby.
  • 6. INSTALLING RUBY Depending on tour system there are many different installation ways. The 3 basic Ways are: 1. You can compile it from source. 2. You can install it through 3rd party tools, RVM – Linux/MacOS, Ruby Installer – Windows. 3. Via package managers: Apt-get install, yum install, brew install, pacman –S etc.
  • 7. FILE EXTENSIONS The most popular file extensions of Ruby (and also Rails) files are: o .rb the Ruby class files. o .gem Ruby package files that may contain Ruby programs and libraries. o .yml data mapping files. o .html.erb Ruby html files.
  • 8. DO YOU SPEAK RUBY? Ruby is a scripting language, which has one goal: To be programmer friendly. So it's expressive, and closer to physical language.
  • 9. SOME RUBY TALK Something no one ever seen before… Let’s do an innovative Hello World example: puts "Hello World!"
  • 10. RUBY LOGIC In Ruby Everything is an object. There are no primitive types. Lines and | are code seperators. No need to declare variable types. For exampe: @name #a variable @name = 2 #a number @name = “Kaiser Chiefs” #a String @name = 1..52 #a range @name = [“Rails”,12,[6,7,9],3..53] #a collection
  • 11. RUBY LOGIC AGAIN A class example class Person attr_accessor :name end Class instance Example bob = Person.new bob.name = “Bob the Builder” Blocks example – blocks are anonymous functions workers = [Bob, Maria, George, Sylvia] for person in workers do puts person.name end workers.each do |person| puts person.name end
  • 12. RUBY LOGIC AGAIN AND AGAIN Iterrators example best_workers = workers.select{|person| person.name.include? ”a”} Hashes are a great way to store things: Hash example fav_djs = {“tiesto” => 8, “deadmau5” => 6, “kaskade” => 3, “benassi” => 7} fav_djs[“deadmau5”] >> 6 fav_djs[“benassi”]+=2 >> 9 fav_djs[“afrojack”] = 5
  • 13. HOW TO HACK SOMETHING USING RUBY… Now we know enough to…
  • 14.
  • 15. SO? WHAT’S RAILS? •Open source • MVC Web Framework •Optimized for programmer happiness. •Developed for database backed web applications,. •Very AGILE
  • 16. FOR STARTERS Rails is a ruby web framework. It was designed by David Heinemeier Hansson. Was released as an open source project on 2004. And joined Mac on 2007.
  • 18. SOMETIMES PICTURES AREN’T ENOUGH • This pattern splits the view (also called the presentation) in "dumb" templates that are primarily responsible for inserting pre-built data in between HTML tags. • The model contains the "smart" domain objects (such as Account, Product, Person, Post) that holds all the business logic and knows how to persist themselves to a database. • The controller handles the incoming requests (such as Save New Account, Update Product, Show Post) by manipulating the model and directing data to the view.
  • 19. RAILS FIGHTS FOR Write Less Do More. DRY – Don’t Repeat Yourself. COC – Convention over Configuration. REST- Representational State Transfer.
  • 20. HOW EASY IS TO LEARN RAILS?
  • 21. RAILS CAPABILITIES •ORM : Object Relational Mapping. •CRUD: Create Read Update Delete a Database. •Both BDD and TDD: Behavior and Test Driven Development. •Ajax and Web Services. •Meta Programming.
  • 22. WHAT IS ORM? Active Record (ORM) An ORM layer built-in maps classes to tables so : •Every row is an object. •Every column is an object attribute. Also it uses conventions to minimize configuration.
  • 23. COMPATIBILITY Most Platforms : Linux, Windows, MacOs etc. Most Databases : MySQL, Sqlite, NoSQL etc. A lot of Web Servers : Nginx, Apache, Passenger etc.
  • 24. RAILS VS JAVA AND PHP
  • 25. GETTING STARTED All Rails Apps use the same structure. No matter the editor or IDE you are using, the projects have the same build. The newer versions always support the older.
  • 26. RAILS 3.0 PROJECT STRUCTURE
  • 27. DEVELOPER TOOLS Editors: vim, gedit, Textmate and more IDEs: RubyMine, Eclipse with plugin, Aptana, Radrails, 3rdR ail
  • 28. GETTING STARTED Installation, 3 steps: 1. Open your terminal, no matter the OS you are using. 2. Type: gem install rails 3. Press enter, sit back and enjoy.
  • 29. BUILD YOUR FIRST APP 1. Open your terminal and cd to the folder where you want to place your project . 2. Type & enter: rails new Project_Name 3. Type & enter: rails s 4. Visit your localhost:3000, from your browser 5. You can see your first rails app running
  • 30. BUILD YOUR FIRST APP This is what you would see…
  • 35. USEFUL LINKS • http://rubyonrails.org/ • http://railsforzombies.org/ • http://ruby.railstutorial.org/ • http://www.aptana.com/products/radrails • http://railscasts.com/ • http://www.ruby-forum.com/forum/rails • http://www.google.gr/
  • 36. AND SOME PERSONAL TIPS Don’t be afraid to search and try, it pays… a lot.
  • 37. THANK YOU !!! Don’t worry guys, Just gotta practice !!!!