2. Agenda
• 1st day: Preparing development environment,
Introduction to Ruby language and ROR framework
• 2nd day: Creating simple application using ROR
• 3rd day: Exercise and review
3. What is Ruby?
• General purpose scripting language: Interpreted Programming
language
• Simple (readable) and elegant (flexible) syntax
• Object oriented: But you can create an application in functional or
procedural way.
• Author: Yukihiro Matsumoto
• Appeared first in 1995; 20 years ago
5. What is ROR?
• Web application framework written in ruby.
• Simple and popular framework
• MVC based action based framework
• Author: David Heinemeier Hansson
• Initial release: 2005
6. The Rails philosophy
• Don't Repeat Yourself: DRY is a principle of software development
which states that "Every piece of knowledge must have a single,
unambiguous, authoritative representation within a system." By not
writing the same information over and over again, our code is more
maintainable, more extensible, and less buggy.
• Convention Over Configuration: Rails has opinions about the best
way to do many things in a web application, and defaults to this set of
conventions, rather than require that you specify every minutiae
through endless configuration files.
7. Competitors or other languages and
frameworks
• Groovy-Grails
• Java-Play, JavaLite
• Python-Django
• Scala-Lift
• Java-Spring Roo (Spring MVC)
• Java-GWT, Vaadin etc.
8. About MVC
• Model - data access layer
• View - UI, presentation layer that renders html response
• Controller - navigating views and connecting model and view.
10. Installing Ruby on Rails 4.2 on windows
• Requirements: 1.9.3 or newer (recommended: ruby 2.1 or later)
• Simple and easiest way: Using Rails Installer
http://railsftw.bryanbibat.net/
11. Checking installed correctly
Type following commands in command prompt
• ruby -v
• rails -v
• sqlite3 --version
• rails new blog
• rails s (or rails server)
12. Installing IDE for Ruby & RAILS
• http://www.aptana.com/index.html
• https://github.com/aptana/studio3/wiki/Getting-Started
14. Trying and learning ruby
• Using puts/print
• Using reverse
• to_s, to_i, to_a
• Processing array, split, join, reverse
• Using for/each loop
• Using if/else statement
• Using while/do while statement etc.
http://www.tutorialspoint.com/ruby/ruby_loops.htm
15. Exercises
• Importing other ruby files and calling other ruby module/library
• Calling ruby application with parameters
• Creating calculator program
• Deriving from other class (creating scientific calculator)