ruby on rails
DESCRIPTION
My first presentation on what is Ruby on RailsTRANSCRIPT
by amol.pujari
puts 'hello ruby on rails'
Why should you switch to Ruby? If you are happy with Perl or Python, you don't have to. But if you do feel there must be a better language, Ruby may be your language of choice. Learning a new language is harmless. It gives you new ideas and insights. You don't have to switch, just learn and try it. You may find yourself comfortable enough with Ruby to decide to switch to it.
- Matz (Yukihiro Matsumoto), written ruby in 1995
Agenda.items.each {|item| puts item}
RoR - Market Trend
Know ruby
Principles Features
Ruby on rails
Principles Building blocks Caching Security Community Support
Market Trend - Need for Ruby on Rails
Less “Time To Market”
Quick to build & deploy
Its free
Rapid application development
Handle traffic – when needed
Huge free libraries with strong community support
Who is using Ruby on Rails
Ruby on Rails – Todays world
Visits/sec
twitter 642
scribd 940
blingee 1170
yellowpages 1734
penny-arcade 2069
43things 4190
kongregate 4488
potchforkmedia 4740
projectpath 5041
funnyordie 5089
1621
232
1041
327
78
158
Around 4000 companies have RubyOnRails adopted in last 4 years
So what is Ruby..?
Ruby
A scripting language
Purely Object Oriented
Extreme dynamic
Easy to learn, simple
Influenced by Python, Perl and Lisp
Open source and free
Cross Platform
Ruby - Programming is fun, enjoy it
You don't want to fight with the language, feel natural
Be creative
Ruby - concise and succinct
Concentrate on the problems
Its like pseudo-code, simple
Focus on human factor
Ruby - extreme dynamic
eval, meta-programming, reflection, Open Classes
Ruby - features
Dynamic yet strong typing
Regular expressions, symbols, mutable strings
Blocks, Iterators, generators
Collections, arrays, hashes
Interpolation, default arguments
Operator overloading
exception handling
Native threads
Custom dispatch behavior (method_missing)
Garbage collection
often my code requires no comments - amol.pujari
if you want to try out all these examples given then download ruby from http://www.ruby-lang.org/en/downloads/ open console, type irb, and enter have fun …end# so simple
ruby on rails
extracted by David Heinemeier Hansson from his work on Basecamp, a project management tool by 37signals
Ruby on Rails: Rapid application development
Web application framework
Free
Very less code
Fast development & client appreciation
Quick incremental development model
Multiple Databases support
Testing support
Continues Integration support
Deployment support
Cloud ready solution
Ruby on Rails: Principles - CoC
Conventions Over Configurations Database table name: books { id(pk), created_at, updated_at }:unicode
Database migration: app/db/migrate/<ts>_create_books.rb
Model: class Book => app/models/book.rb
Views: app/views/books/
Controller: class BooksController => app/controllers/books_controller.rb
Unit tests: app/test/unit/book_test.rb
Fixtures: app/test/fixtures/books.yml
Functional tests: test/functional/books_controller_test.rb
Routes: resources :books =>
Ruby on Rails: Principles - DRY
Don't Repeat Yourself
Rails: building blocks
ORM: Active Record
Action Pack
Action Dispatch Action Controller Action View
Active Support
Active Model, Active Resource, Action Mailer
Railties
Rails: Active Record
CRUD support
Model level validations
Callbacks
migrations
Associations
Query interface
Rails: Active Record: Association
Rails: Active Record: Association
Rails: inbuilt caching
SQL Caching
caches_page :index
caches_action :index
Fragment caching => <% cache do %> ...<% end %>
ActiveSupport::Cache::Store
config.cache_store = :memory_store
# :FileStore, :mem_cache_store, :redis,
Rails: Security
Session Hijacking
Stealing a user’s session_id Use database store and SSL
Session Fixation
Attacker fixes a session id known to her Issue a new session identifier (reset_session in RAILS)
Cross-Site Request Forgery (CSRF)
Rails includes a security token in non-GET requests SQL Injection
Unauthorized reading/writing Model.first(:conditions => ["login = ? AND password = ?",
entered_user_name, entered_password]) attr_protected :is_admin
HTML/JavaScript Injection
h @book.description # => 'alert('script inside');'
Ruby on Rails – wider support Databases
Ibm db2
Oracle
MsSql
Mysql
Postgres
Sqlite
Mongodb
Cassandra
BerkleyDB
UI
HTML 5
Flash
Flex
Scripts
Ajax
Jquery
Prototype
Css 3
Coffeescript
Performance
J-meter
Yslow, Firebug
Five-runs
New-relic
Http-perf
Memcache, redis
Apache benchmark
Standards
XML/REST
MVC/ORM
Deployment
Apache
NGINX
Mongrel
Glassfish
phusion-passanger
WebSphere
Rack
metal
Development
Neatbeans
Apatana
Eclipse
Radrails
Project Management
Redmine
Trac
Basecamp
Spring loop
Assembla
Repositories
Svn, cvs
Github
Mercurial
Visual Source Safe
Continues Integration
Capistrano
Cruise Control
moonshine
Security
Md5, Kerberos
Sha1, Sha2
Platforms
All flavors of linux
Windows, MS DOS, Mac
CMS
Wordpress, Mephisto
Comatoes, Radiant
spree
Testing
Cuccumber, Rspec
Factory-girl, selenium
Flavors
Jruby
Iron ruby
Rubinies
Ruby shoes
Sinatara
Merb
Thanks. :)
any queries?