Ruby on Rails: Building Web Applications Is Fun Again!

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    43 Favorites

    Ruby on Rails: Building Web Applications Is Fun Again! - Presentation Transcript

    1. Ruby on Rails Building Web Applications Is Fun Again!
    2. What is Ruby on Rails?
      • Web application framework written in Ruby
      • Ruby is an Object Oriented scripting language
      • Model-view-controller
      • Database agnostic
      • Open source
      • Lots of nice tools, classes and methods to make development easier
    3. The Rails Way
      • DRY (Don’t Repeat Yourself)
      • Convention over configuration
      • Baked in testing
      • Minimal code with maximum effect
      • Installing Ruby, Gem and Rails
      • Install Ruby OCI8 Driver
      • Connect using TNSNAMES.ORA
      • Connect using InstantClient and a URL
      • More information on wiki.rubyonrails.com
      Getting Started
    4. Rails on Oracle
      • Key generation assumes sequences for each table with the name ${table_name}_seq
      • Sequence name can be changed using ActiveRecord::Base.set_sequence_name
      • Timezones and sub-second precision not supported
      • More info: http://wiki.rubyonrails.com/rails/pages/Oracle
    5. Building Your First App
      • Create a new Rails app by typing: rails myapp
      • Edit the config/database.yml
      • Generate a model using: script/generate model MyModel
      • Creating a model creates a class and a migration
    6. ActiveRecord Conventions
      • Naming convention simplifies development and encourages good database design
      • Tables are plural, models are singular
      • Example:
        • Model: LineItem
        • Table: line_items
      • Handles non-regular pluralization such as Person/people
      • Can be overridden, although this complicates things for the developer
    7. Database Migrations
      • Database agnostic means of defining schema
      • Lowest-common-denominator approach
      • Ruby code with full access to ActiveRecord
      • Methods for creating, altering and dropping tables, columns and indexes
      • Can execute arbitrary SQL with ‘execute’ method
    8. ActiveRecord Models
      • Object/Relational Mapping
      • Model classes extend from ActiveRecord::Base
      • ActiveRecord::Base provides:
        • Database agnostic record creation, finding, saving and removal
        • Data validation methods
        • Relationships
        • All in an easy to use package
      • Rails encourages keeping business logic in the model where it belongs
      • AR can be used outside of web applications
    9. Views
      • Responsible for creating part or all of the page displayed in a browser
      • By default uses ERb (Embedded Ruby)
      • Other views include ‘builders’ for XML documents or RJS templates to generate JavaScript for AJAX driven views
      • Includes elegant means for including helper functions for rendering
      • Supports partials and components
    10. Controllers
      • Generate controllers with script/generate controller MyController
      • Controllers tie the view to the model through actions
      • Controllers also have access to “helpers”
      • Designed for people-friendly URLs
      • Provides caching, session management, query parsing, cookie management, pagination
    11. ActiveRecord Relationships
      • Relationships are through primary keys
      • Supported relationship types:
        • belongs_to (book belongs to author)
        • has_one (book has one publisher)
        • has_many (book has many pages)
        • has_and_belongs_to_many (book has and belongs to many readers)
        • has_many :through (book has many contributors through contributions)
    12. ActiveRecord Validation
      • validates_presence_of
      • validates_uniqueness_of
      • validates_confirmation_of
      • validates_acceptance_of
      • validates_associated
      • validates_each
      • validates_format_of, _length_of
      • validates_exclusion_of, _inclusion_of
    13. More ActiveRecord
      • Acts As
        • acts_as_list (position)
        • acts_as_tree (parent_id)
      • Aggregations
        • composed_of
      • Callbacks
        • Full lifecycle
        • Before and after validation, creation, saving, destroying
      • Calculations
        • average, count, maximum, minimum, sum
    14. Just When You Thought You Had Enough ActiveRecord
      • Callback objects
      • Observers
      • Façade columns
      • Object-level transaction management
      • Magic column names
        • created_on, created_at, updated_on, updated_at auto timestamping and dating
        • lock_version and optimistic locking
        • type for single table inheritence
        • xxx_count counter cache
    15. Other Stuff
      • ActionMailer for sending mail messages
      • ActionView helpers
        • Form helpers
        • Asset tags
        • Javascript support (yummy AJAX!)
        • Pagination
        • Text helpers
      • ActionWebService
      • Ruby language extensions
      • Breakpoint and debugging
    16. Where To Go Next?
      • http://www.rubyonrails.com /
      • http://api.rubyonrails.com /
      • http://wiki.rubyonrails.com/
      • Agile Web Development with Rails
      • http://www.ruby-doc.org/ for Ruby
      • Programming Ruby
      • IRC, Mailing Lists, Seth Ladd’s brain

    + judofyrjudofyr, 4 years ago

    custom

    12693 views, 43 favs, 4 embeds more stats

    Anthony Eden presentents us for Ruby on Rails.

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 12693
      • 12669 on SlideShare
      • 24 from embeds
    • Comments 0
    • Favorites 43
    • Downloads 1
    Most viewed embeds
    • 21 views on http://www.slideshare.net
    • 1 views on http://www.lonerunners.net
    • 1 views on http://vasselc.ninehub.com
    • 1 views on http://phuha.net

    more

    All embeds
    • 21 views on http://www.slideshare.net
    • 1 views on http://www.lonerunners.net
    • 1 views on http://vasselc.ninehub.com
    • 1 views on http://phuha.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories