Your SlideShare is downloading. ×
0
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Ruby on Rails For .Net Programmers
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ruby on Rails For .Net Programmers

4,419

Published on

An introduction to Ruby on Rails for .NET programmers

An introduction to Ruby on Rails for .NET programmers

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
4,419
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
227
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. me http://shinydevelopment.com
  • 2. Hype
  • 3. “Ruby on Rails is astounding. Using it is like watching a kung-fu movie, where a dozen bad-ass frameworks prepare to beat up the little newcomer only to be handed their asses in a variety of imaginative ways.” Nathan Torkington
  • 4. “Powerful web applications that formerly might have taken weeks or months to develop can be produced in a matter of days.” Tim O'Reilly
  • 5. What is Ruby on Rails?
  • 6. Ruby Language C# or VB.NET on Rails Framework ASP.NET
  • 7. Ruby
  • 8. Ruby is Object Oriented
  • 9. > 2.next => 3 > “Hello”.reverse => “olleH” > 2.class => Fixnum > 2.class.class => Class
  • 10. > 2.class => Fixnum > 2.class.superclass => Integer > 2.class.superclass.superclass => Numeric > 2.class.superclass.superclass.superclass => Object
  • 11. Ruby is Readable
  • 12. > 5.times { print quot;Hello quot; } Hello Hello Hello Hello Hello > print “Stuff” unless x.nil? => Stuff > [3, 5, 78, 2, 43].sort.reverse => [78, 43, 5, 3, 2] > 2.weeks.from_now.utc => Wed Dec 27 11:25:06 UTC 2006
  • 13. > [1, 2].empty? => false > x.nil? => true
  • 14. > arr = [5, 4, 3] > arr.sort => [3, 4, 5] # arr is still [5, 4, 3] > arr.sort! => [3, 4, 5] # arr is now [3, 4, 5]
  • 15. Ruby is Dynamic
  • 16. > Linguistics::use(:en) > quot;runsquot;.en.present_participle => quot;runningquot; > 5.en.ordinal => quot;5thquot; > quot;cowquot;.en.quantify(1005) => quot;thousands of cowsquot;
  • 17. > animals = %w{dog cow ox chicken goose goat cow dog rooster llama pig goat dog cat cat dog cow goat goose goose ox alpaca} > puts quot;The farm has quot; + animals.en.conjunction => “The farm has four dogs, three cows, three geese, three goats, two oxen, two cats, a chicken, a rooster, a llama, a pig, and an alpaca”
  • 18. class ReverseString def method_missing(method_name) return method_name.to_s.reverse end end > s = ReverseString.new > s.Hello_World => “dlroW_olleH”
  • 19. Rails
  • 20. “Ruby on Rails is an opinionated framework for developing web applications”
  • 21. Convention over Configuration
  • 22. Model Controller View
  • 23. ActiveRecord ActionPack Model View & Controller ActiveSupport JavaScript Libraries Prototype & Script.aculo.us ActionMailer ActionWebService
  • 24. Convention over Configuration
  • 25. Table Class groups Group people Person string.pluralize ABC_usrdetails User table_name_prefix “ABC_” set_table_name “usrdetails”
  • 26. Dynamic Scaffolding and Validations demo
  • 27. Magic?
  • 28. scaffold :customer
  • 29. Ruby is Dynamic
  • 30. Hey, have you seen my new Rails app? I can imagine! *sigh*
  • 31. script / generate
  • 32. More Magic?
  • 33. Routing
  • 34. URL http://localhost:3000/customer/show/2 Routes.rb map.connect ':controller/:action/:id'
  • 35. ActiveRecord
  • 36. “The essence of an Active Record is a domain model in which the classes match very closely the record structure of an underlying database. Each active record is responsible for saving and loading to the database and also for any domain logic that acts on the database” Martin Fowler
  • 37. ActiveRecord ActionPack Model View & Controller MySQL PostgreSQL ActiveSupport JavaScript Libraries MS SQL - ADO Prototype & Script.aculo.us MS SQL - ODBC Oracle ActionMailer ActionWebService SQLite DB2
  • 38. class Customer < ActiveRecord::Base end >> Customer.column_names => [quot;idquot;, quot;namequot;, quot;emailquot;, quot;notesquot;] >> Customer.columns_hash[quot;idquot;] => default=nil, text=false, null=false, sql_type=quot;int(11)quot;, primary=true, name=quot;idquot;, type=:integer, number=true
  • 39. class Customer < ActiveRecord::Base end Customer.find(:all) Customer.find(1) Customer.find_by_email(‘bill@example.com’) Customer.find_by_email_or_name( ‘bill@example.com’, ‘Ben’)
  • 40. class Customer < ActiveRecord::Base end Customer.new do |c| c.email = ‘bill@example.com’ c.name = ‘Bill’ c.save end Customer.delete(1)
  • 41. ActiveRecord Relationships
  • 42. Describe the relationship “A customer has many orders and an order belongs to a customer.”
  • 43. has_many belongs_to
  • 44. Database Relationships demo
  • 45. More Magic?
  • 46. Ruby is Dynamic
  • 47. Orders id Customers customer_id id item name email quantity notes unit_price
  • 48. customer = Customer.find(params[:id]) customer.orders.create(params[:order])
  • 49. Migrations demo
  • 50. Capistrano
  • 51. What next?
  • 52. Try Ruby http://tryruby.hobix.com
  • 53. Instant Rails http://instantrails.rubyforge.org
  • 54. Locomotive http://locomotive.raaum.org/
  • 55. SubSonic http://www.codeplex.com/Wiki/View.aspx? ProjectName=actionpackext Castle Project http://www.castleproject.org/
  • 56. IronRuby
  • 57. Newcastle Ruby on Rails User Group
  • 58. Thank You dave.verwer@shinydevelopment.com

×