background preloader

Ruby/ Ruby on Rails

Facebook Twitter

Ruby on Rails Screencasts - RailsCasts. Getting Started with Rails. 1 Guide Assumptions.

Getting Started with Rails

Ruby on Rails Resources. Ruby on Rails Examples. In this chapter, we will create a simple but operational online library system for holding and managing the books.

Ruby on Rails Examples

This application has a basic architecture and will be built using two ActiveRecord models to describe the types of data that is stored − Books, which describes an actual listing.Subject, which is used to group books together. Ruby-Doc.org: Documenting the Ruby Language. Documentation. Here you will find pointers to manuals, tutorials and references that will come in handy when you feel like coding in Ruby.

Documentation

Installing Ruby Unless you only want to try Ruby in the browser (see the links below) you need to have Ruby installed on your computer. You can check whether Ruby already is available by opening a terminal and typing This should output some information on the installed Ruby version. If not, see the installation page for various options of getting Ruby. Getting Started. Ruby screencasts. Documentation. Ruby tutorial. Ruby tutorial. Ruby screencasts. Ruby-Doc.org: Documenting the Ruby Language. Documentation. Ruby - Computers & Technology. Ruby. Model–view–controller. Model–view–controller (MVC) is a software pattern for implementing user interfaces.

Model–view–controller

It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user.[1][2] The central component, the model, consists of application data, business rules, logic and functions. A view can be any output representation of information, such as a chart or a diagram. Multiple views of the same information are possible, such as a bar chart for management and a tabular view for accountants. The third part, the controller, accepts input and converts it to commands for the model or view.[3] Component interactions[edit] A typical collaboration of the MVC components In addition to dividing the application into three kinds of components, the Model–view–controller (MVC) design defines the interactions between them.[4] Use in web applications[edit]

Don't repeat yourself. Applying DRY[edit] DRY vs WET solutions[edit] Violations of DRY are typically referred to as WET solutions, which is commonly taken to stand for either "write everything twice" or "we enjoy typing".[2][3]

Don't repeat yourself

Convention over configuration. Convention over configuration (also known as coding by convention) is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility.

Convention over configuration

The phrase essentially means a developer only needs to specify unconventional aspects of the application. For example, if there's a class Sale in the model, the corresponding table in the database is called “sales” by default. It is only if one deviates from this convention, such as calling the table “sale”, that one needs to write code regarding these names. When the convention implemented by the tool matches the desired behavior, it behaves as expected without having to write configuration files. Only when the desired behavior deviates from the implemented convention is explicit configuration required. Active record pattern. This pattern is commonly used by object persistence tools, and in object-relational mapping (ORM).

Active record pattern

Typically, foreign key relationships will be exposed as an object instance of the appropriate type via a property. Implementations[edit] Implementations of the concept can be found in various frameworks for many programming environments. For example, if in a database there is a table parts with columns name (string type) and price (number type), and the Active Record pattern is implemented in the class Part, the pseudo-code part = new Part() part.name = "Sample part" part.price = 123.45 part.save() Rails Girls. Rails/rails. Ruby on Rails. Solution stack. In computing, a solution stack is a set of software subsystems or components needed to perform a task without further external dependencies.

Solution stack

For example, to develop a web application, the designer needs to use an operating system, web server, database, and programming language. Another version of a solution stack is operating system, middleware, database, and applications.[1] Linux-based solution stacks[edit] Ruby on Rails. Ruby on Rails emphasizes the use of well-known software engineering patterns and principles, such as active record pattern, convention over configuration (CoC), don't repeat yourself (DRY), and model–view–controller (MVC).

Ruby on Rails

History[edit] On December 23, 2008, Merb, another web application framework, was launched, and Ruby on Rails announced it would work with the Merb project to bring "the best ideas of Merb" into Rails 3, ending the "unnecessary duplication" across both communities.[7] Merb was merged with Rails as part of the Rails 3.0 release.[8][9] Rails 3.2 was released on January 20, 2012 with a faster development mode and routing engine (also known as Journey engine), Automatic Query Explain and Tagged Logging.[11] Rails 3.2.x is the last version that supports Ruby 1.8.7.[12] Rails 3.2.12 supports Ruby 2.0[13]

Learn Ruby with the Neo Ruby Koans. Code School - Rails for Zombies. Ruby Tutorial - Learn Ruby. Ruby tutorial. Home This is a Ruby tutorial.

Ruby tutorial

In this tutorial you will learn the Ruby language. The tutorial is suitable for beginners. Table of contents. Learn Web Development with the Ruby on Rails Tutorial. Ruby in Twenty Minutes. Introduction. Ruby Tutorial. Ruby is a scripting language designed by Yukihiro Matsumoto, also known as Matz. It runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. This tutorial gives a complete understanding on Ruby. This reference has been prepared for the beginners to help them understand the basic to advanced concepts related to Ruby Scripting languages. Before you start doing practice with various types of examples given in this reference, I'm making an assumption that you are already aware about what is a computer program and what is a computer programming language.

For most of the examples given in this tutorial, you will find Try it option, so just make use of it and enjoy your learning. Try following example using Try it option available at the top right corner of the below sample code box: Programming Ruby: The Pragmatic Programmer's Guide. Code School - TryRuby. Programming Ruby: The Pragmatic Programmer's Guide. Ruby-Doc.org: Documenting the Ruby Language. Ruby on Rails: Documentation. Ruby on Rails: Screencasts.