Ruby on Rails: An Overview


Ruby is a programming language. It was produced 20 years earlier by Yukihiro “Matz” Matsumoto. By many steps of programming language appeal, Ruby ranks among the top ten, though normally as tenth (or so) in appeal, and mostly due to the popularity of Rails Like Java or the C language, Ruby is a general-purpose programming language, though it is best understood for its use in web programming.


Rails is a software library that extends the Ruby programming language. David Heinemeier Hansson is its creator. He offered it the name “Ruby on Rails,” though it is frequently simply called “Rails.”.

It is software code that is added to the Ruby programming language. Technically, it is a package library (particularly, a RubyGem), that is set up using the operating system command-line interface.

Rails is a framework for developing websites. As such, Rails develops conventions for simpler collaboration and maintenance. These conventions are codified as the Rails API (the application programming interface, or instructions that control the code). The Rails API is documented online and described in books, short articles, and article. Learning Rails indicates learning the best ways to use the Rails conventions and its API.

Rails combines the Ruby programming language with HTML, CSS, and JavaScript to create a web application that runs on a web server. Since it works on a web server, Rails is thought about a server-side, or “back end,” web application development platform (the web browser is the “front end”). Later, this post will describe web applications in greater depth and show why a web development framework is needed to build complex websites.

Rails, in a bigger sense, is more than a software library and an API. Rails is the main project of a large community that produces software libraries that simplify the task of building complex sites. Members of the Rails community share numerous core values, commonly use the very same tools, and support each other with a casual network that is built on volunteerism. Overlapping the informal community is an economic network that consists of jobs, recruiters, consulting companies, conferences, businesses that build sites with Rails, and investors that money start-ups. Rails is popular among web startups, substantially due to the fact that the pool of open source software libraries (RubyGems, or “gems”) makes it possible to build complex websites quickly.

Why Ruby?

In a podcast from This Developer’s Life and in an interview from 2005, David Heinemeier Hansson, the creator of Rails, describes constructing an online project management application called BaseCamp in 2004. He had actually been using the PHP programming language due to the fact that he could get things done quickly but was disappointed because of a lack of abstraction and frequently repetitive code that made PHP “unclean.” Hansson wanted to use the “clean” software enginering abstractions supported in the Java programming language but found development in Java was troublesome. He tried Ruby and was excited about the ease of use (he calls it enjoyment) he discovered in the Ruby language.

Ruby is known amongst developers for a terse, uncluttered syntax that does not need a great deal of additional punctuation. Compared to Java, Ruby is streamlined, with less code needed to produce basic structures such as data fields. Ruby is a modern-day language that makes it easy to use high-level abstractions such as metaprogramming. In particular, metaprogramming makes it simple to develop a “domain certain language” that tailors Ruby for a particular set of uses (Rails and lots of gems use this “DSL” capability).

Ruby’s key advantage is RubyGems, the plan manager that makes it simple to create and share software libraries (gems) that extend Ruby. RubyGems provides a simple system to set up gems. Anyone can publish a gem to the central RubyGems website, making the gem right away offered for installation by anybody. The RubyGems website is where you’ll obtain the most current version of Rails. And it is where you will acquire all the gems that help you build complex websites.

Ruby has numerous disadvantages (a minimum of when programmers want to say). Its processing performance is sluggish relative to C++ or Java. The execution speed of a language is seldom essential, however, relative to the benefits gained by programmer performance and the basic level of performance needed by the majority of websites. For websites that require great deals of simultaneous activity, Ruby is not appropriate to the advanced software engineering required to perform simultaneous activity efficiently (basic Ruby lacks “parallelism”, though some variations support it). Last but not least, some programmers whine that Ruby programs (and particularly Rails) include “too much magic” (that is, complex operations that are concealed behind easy directives). These concerns have not stopped Rails from becoming a popular web development platform.

Why Rails?

Rails is popular and widely made use of due to the fact that its conventions are pervasive and astute. Any web application has complex requirements that consist of basic functions such as creating HTML, processing kind submissions, or accessing a database. Without a web application development framework, a programmer has a mammoth task to carry out all the needed facilities. Even with a web application development framework, a programmer can take an idiosyncratic method, developing something that no one else can quickly take apart and understand. The singular virtue of Rails is that Heinemeier Hansson, and the core team that joined him, decided that there is one best method to execute much of the facilities required by a web application. Many of the implementation decisions appear approximate. In fact, though Heinemeier Hansson is commonly berated as autocratic in his approach to enhancing Rails, the Rails API reflects deep experience and intelligence in implementing the requirements of a web application development framework. The advantage is that every developer who discovers the “Rails way” produces a web application that any other Rails developer can unwind and understand more quickly than if they came across idiosyncratic code without as many conventions. That implies collaboration is simpler, development is quicker, and there’s a bigger pool of open source libraries to improve Rails.

The benefit of establishing conventions might seem obvious, however when Rails was launched in 2004, web development was dominated by PHP, which provided itself to idiosyncratic code produced by solo webmasters, and Java frameworks such as Struts, which were typically viewed as strained by an unwanted of structure. Other frameworks, such as Apple’s WebObjects, Adobe’s ColdFusion, and Microsoft’s. WEB Framework, were in broad use however the frameworks were items controlled by the companies and built by small teams, which tended to restrict innovation. Today PHP, Java frameworks, and.NET stay popular, mainly amongst solo web designers (PHP), enterprise teams (Java), and Windows fanatics (. WEB) however Rails has actually ended up being popular and has actually influenced development of other server-side frameworks.

How Rails Works

With an understanding in place of the Rails guiding concepts and its difficulties, let’s go back to square one to obtain a clear photo of how Rails works. We’ll begin by explaining how a web application is made use of to create a website. You may currently understand most of this, however let’s review due to the fact that it will certainly help explain how Rails works.

You’re running a web browser on your computer system (probably to read this post). A web browser combines 3 sort of files– HTML, CSS, and JavaScript– to show websites. A browser gets the files from a web server. The web server can be remote (connected by the Internet) or on your own computer system (when you are doing development).

You may have learned ways to produce HTML, CSS, and JavaScript files. HTML (HyperText Markup Language) is a convention for developing structured files that incorporate content (such as text, images, or video) with generic typographic, design and design elements (such as headlines and tables). CSS (Cascading Style Sheets) instructions use a certain appearance to typographic, layout and design elements. JavaScript is a programming language supported by all web browsers that is made use of to control HTML and CSS aspects, particularly for executing interactive features such as tabs and modal windows. You can find out about HTML, CSS, and JavaScript in a typical “Introduction to Web Design” course that teaches the best ways to make “fixed sites.”.

Web servers deliver HTML, CSS, and JavaScript, either from fixed files that are saved on the server, or from an “application server” that develops files dynamically using a programming language such as Ruby. A software program written in Ruby and organized using Rails conventions is a “web application.” Rails combines the Ruby programming language with HTML, CSS, and JavaScript to develop a web application. Rails uses Ruby to dynamically assemble HTML, CSS, and JavaScript files from part files (commonly adding content from a database).

Why produce a web application? A web browser requires just a single HTML file to show a web page (CSS and JavaScript files are optional). However, if you are developing numerous web pages, you may want to assemble the HTML file from smaller sized elements. For example, you might make a small file that will be included on every page to make a footer (Rails calls these “partials”). Consider another example: If you are displaying content from a database, you may not want the complex programming code that accesses the database mixed into your HTML (developers call this separation of issues and it produces more modular, maintainable programs). Lastly, if you are using a web application server such as the one provided with Rails, you can add features to your website that have actually been developed and tested by other individuals so you do not need to build everything yourself. These are all needs to develop a web application.

Rails Stack

The set of technologies or software libraries that are utilized to develop an application or deliver web pages is called a technology “stack.” For example, Mark Zuckerberg established Facebook in 2004 using the LAMP stack consisting of Linux (operating system), Apache (web server), MySQL (database), and PHP (programming language). Rails, as a web development framework, and Ruby, as a programming language, can be made use of with an option of running systems (Linux, Mac OS X, Windows), databases (SQLite, MySQL, PostgreSQL, and others), and web servers (Apache, Nginx, and others).

As a beginner, your technology stack will consist of Ruby on Rails, the WEBrick web server (it has Ruby), the SQLite database, and the Linux, Mac OS X, or Windows running system (whatever is set up on your computer system).

The Rails stack can also include a range of software libraries (gems) that add functions to a website or make development much easier. Often the option of components in a stack is driven by the requirements of an application. At other times, the stack refers individual choice. Just as craftsmen and enthusiasts discuss the merits of favorite tools and methods in other profession, Rails developers avidly dispute what’s the very best Rails stack for development. Sometimes it appears conversation leads to more heat than light.

Sometimes it is challenging to identify what’s at stake or perhaps what’s being talked about. You’ll be challenged as you look for to figure out technical issues from matters of style or preference. However you can discover much about Rails by following these arguments. These debates are a source for much innovation and enhancement of the Rails framework. In the end, the power of the crowd dominates; generally the best elements in the Rails stack are the most popular.

Post a comment