Your SlideShare is downloading. ×
Ruby on Rails : First Mile
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 : First Mile

918
views

Published on

This was presented in a workshop series in 2010 at Birla Institute of Technology, Mesra (Ranchi). It was a 2 hour Ruby on Rails introduction and demo

This was presented in a workshop series in 2010 at Birla Institute of Technology, Mesra (Ranchi). It was a 2 hour Ruby on Rails introduction and demo

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
918
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
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
  • Matz ,
  • Basecamp
  • Thinking inRuby : Just the psychology behind ruby. What its meant to be? Conceptual elegance.
  • Transcript

    • 1. “I always knew that one daySmalltalk would replace Java. Ijust didn’t know it would be calledRuby.”– Kent Beck, MountainWest RubyConf 2009
    • 2. o dynamic, reflective, general purpose object-oriented programming languageo designed by Yukihiro "Matz" Matsumoto. It was influenced primarily by Perl, Smalltalk, Eiffel, and Lisp.o Ruby supports multiple programming paradigms, including functional, object oriented, imperative and reflective. It also has a dynamic type system and automatic memory management; it is therefore similar in varying respects to Python, Perl, Lisp, Dylan, Pike, and CLU.o alternative implementations of the Ruby language, including YARV, JRuby, Rubinius, IronRuby, MacRuby, and HotRuby, each of which takes a different approach, with IronRuby, JRuby and MacRuby providing just-in-time compilation and MacRuby also providing ahead-of-time compilation
    • 3. o open source web application framework for the Ruby programming language.o It is intended to be used with an Agile development methodology that is used by web developers for rapid developmento Ruby on Rails was extracted by David Heinemeier Hansson from his work on Basecamp, a project management tool by 37signals (now a web application companyo David Hansson first released Rails as open source in July 2004
    • 4. o By helping you know what the code in your application is doingo By helping you do more in, and with, your Rails applications that you can if you limit yourself to the readily available Rails idioms and techniqueso By allowing you to familiarize yourself with the Rails source code, which in turn enables you to participate in discussions about Rails and perhaps submit bugs and patches.o By giving you powerful tool for administrative and organization tasks connected with your application.
    • 5. Ruby ConceptsRuby for RailsRails ConceptsHello RoRFirst RoR AppFurther reading
    • 6. Ruby ConceptsRuby for RailsRails ConceptsHello RoRFirst RoR AppFurther reading
    • 7. • Thinking in Ruby• IRB• Hello World
    • 8. Ruby ConceptsRuby for RailsRails ConceptsHello RoRFirst RoR AppFurther reading
    • 9. Ruby ConceptsRuby for RailsRails ConceptsHello RoRFirst RoR AppFurther reading
    • 10. • Ruby Constructs• Importance of Ruby• Extending Rails and other frameworks
    • 11. Ruby ConceptsRuby for RailsRails ConceptsHello RoRFirst RoR AppFurther reading
    • 12. Ruby ConceptsRuby for RailsRails ConceptsHello RoRFirst RoR AppFurther reading
    • 13. • MVC• Server• Convention over Configuration• Structure of a Rails App• DRY(Don’t Repeat Yourself)• Migrations• Gems• Routes• And other topics
    • 14. o Stands for Model-View-Controllero Model is responsible for maintaining the state of an applicationo View layer provides the user interfaceof an application
    • 15. o WEBricko Mongrelo > ruby script/servero > gem server
    • 16. o All you need is common sense and it works like magic!o Comparison with C# , Javao No Connection String
    • 17. o Another example of convention over configurationo Advantageso > ruby script/console
    • 18. Implications of DRY in RoR ;migrations , seeds etc.
    • 19. 1. Migrations are a convenient way for you to alter your database in a structured and organized manner. You could edit fragments of SQL by hand but you would then be responsible for telling other developers that they need to go and run them. You’d also have to keep track of which changes need to be run against the production machines next time you deploy.2. db/schema.rb3. Timestamp4. Use of migrations in case of faulty code generation
    • 20. class CreateProducts < ActiveRecord::Migrationdef self.up create_table :products do |t| t.string :name t.text :description t.timestamps endenddef self.down drop_table :productsendend
    • 21. > rake db:migrateVERSION=<timestamp>> ruby script/generatemigrationAdd<Field>To<ContollerName> fieldname:type
    • 22. o routes.rbo map.root
    • 23. 1. > gem install <gem-name>2. > gem install <gem-name> --local3. > gem update –system4. > gem server5. From setup.rb … >ruby setup.rb6. From gemspec .. >gem build example.gemspec7. Get gemspecs / .gems form Rubyforge.com or github8. Rake gem:install
    • 24. Hello RoR
    • 25. http://rubyonrails.orghttp://railsbrain.comhttp://railscasts.comhttp://asciicasts.comhttp://github.com
    • 26. o Gourab Mitra gourab5139014@gmail.com http://gourabmitra.co.cco Sujeet Kumar sujeet0s1@gmail.com http://bit.ly/aEFKTT