ror framework

Upload: sanjay-kaushik

Post on 04-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 RoR Framework

    1/10

    Sanjay KaushikMCA,HMR ITM, Delhi18 October 2012

  • 7/31/2019 RoR Framework

    2/10

    a modern programming language available for Windows, Mac OS, Unix/Linux, Java (JRuby),

    .NET (IronRuby), and Android (Ruboto) flexible and easy to read and write:

    def is_lower_48?(address)address.country == "United States" and

    not ["AK", "HI"].include?(address.state)end

    designed to maximize programmer happiness

  • 7/31/2019 RoR Framework

    3/10

    a framework for building web applications in Ruby a set of strong ideological opinions about how web

    applications should be structured a particularly good tool for building prototypes rapidly

    (which doesn't mean it's only good for that) a thriving, productive, fractious community of free software

    developers a constantly growing and changing software ecosystem

    with libraries to do almost anything

  • 7/31/2019 RoR Framework

    4/10

    Lots of web applications you've heard of:Basecamp, Twitter, Hulu, Groupon, ...

    Blacklight (projectblacklight.org),a Solr-based discovery interface

    Umlaut (wiki.code4lib.org/index.php/Umlaut),a link resolver enhancer

    Library Lab projects developed at the Berkman Center(like the Widener carrel reservation app)

    The HCL annotated bibliography application I wrote

  • 7/31/2019 RoR Framework

    5/10

    Web pages, with instructions in them to do things

    Today's date is#DateFormat(today, "yyyy-mm-dd")#

    It's a lot like writing a regular website, only every so oftenyou tell the server to do something

    Usually you eventually reach an unmaintainable mess

  • 7/31/2019 RoR Framework

    6/10

    Partition your program into three basic responsibilities:o The modelis your representation of data (bibliographic

    records, search queries, shopping carts, ...)o The viewis the web pages that you show to the user, and

    all the behavior they containo The controllerdirects traffic, receiving requests from the

    user, deciding what actions to take, and mediatingbetween model and view

    Every major web programming platform provides a way foryou to follow this paradigm

    Rails forces you to from the very beginning

  • 7/31/2019 RoR Framework

    7/10

  • 7/31/2019 RoR Framework

    8/10

    RSpec fortest-driven development Cucumber forbehavior-driven development

    Scenario: Request to create a new collectionGiven I open the topic at the home pageWhen I follow "create a new collection"

    Then I should be on the collection creation form

    jQuery is now built in (as of Rails 3.1)

  • 7/31/2019 RoR Framework

    9/10

    Ruby, in and of itself, is a friendly programming languageand a good one for people who are new to programming

    Rails is a wonderful system for building web applications,ifyou can program or want to learn programming

    Ruby on Rails has a steeper learning curve than page-centered systems like PHP or ColdFusion

    If you need to build an interactive web thing and don't reallylike the idea of programming, try Drupal instead

  • 7/31/2019 RoR Framework

    10/10

    Questions?