首页 | 主题 | 图库 | 问答 | 文摘 | 原创 | 百科

历史 | 地理 | 人物 | 艺术 | 体育 | 科学 | 音乐 | 电影 | 信息技术 | 世界遗产

 开放、中立,源自维基百科

Personal tools

Ruby on Rails

From Wikipedia, the free encyclopedia

Jump to: navigation, search
Ruby on Rails
Image:Rails default index.png
The Rails Default Page
Developed by Rails Core Team
Latest release 2.0.2 / December 17 2007 (2007-12-17), 654 days ago
Written in Ruby
OS Cross-platform
Genre Web application framework
License MIT License
Website http://www.rubyonrails.org

Ruby on Rails is a free web application framework. It aims to increase the speed and ease with which database-driven web sites can be created, and offers skeleton code frameworks (scaffolding) from the outset. Often shortened to Rails, or RoR, Ruby on Rails is an open source project written in the Ruby programming language, and applications using the Rails framework are developed using the Model-View-Controller design paradigm.

Contents

Philosophy

The fundamental Ruby on Rails principles include Convention over Configuration (CoC) and Don't repeat yourself (DRY).

"Convention over Configuration" 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 "products_sold", that one needs to write code regarding these names.

"Don't repeat yourself" means that information is located in a single, unambiguous place. For example, using ActiveRecord, the developer does not need to specify database column names in class definitions. Instead, Ruby can retrieve this information from the database.

History

Ruby on Rails was extracted by David Heinemeier Hansson from his work on Basecamp, a project management tool by the web design (now web application) company 37signals.[1] It was first released to the public in July 2004. In August 2006 Apple announced that it would ship Ruby on Rails with Mac OS X v10.5 Leopard,[2] which was released in October 2007.

Technical overview

Like many contemporary web frameworks, Rails uses the Model-View-Controller (MVC) architecture for organizing application programming.

Rails provides 'out of the box' scaffolding which can quickly construct most of the models and views needed for a basic website. Other helpful development tools come with or are installed with Rails, such as the WEBrick web server, and the Rake build system.

Rails is also noteworthy for its extensive use of the JavaScript libraries Prototype and Script.aculo.us for Ajax and its graphical interface.

For web services Rails initially supported lightweight SOAP; later it was replaced by RESTful web services. The recommended REST-based programming structure changed drastically in version 1.2.

Framework structure

Ruby on Rails divides itself into various packages, namely ActiveRecord, ActiveResource, ActionPack, ActiveSupport and ActionMailer. (Prior to version 2.0, Rails also included the Action Web Service package which is now replaced by Active Resource.) Apart from standard packages, developers can make plugins to extend existing packages.

Legal issues

In March 2007 David Heinemeier Hansson filed three Rails related trademark applications to the USPTO. These applications regard the phrase "RUBY ON RAILS",[3] the word "RAILS"[4] and the official Rails logo.[5] As a consequence, in the summer of 2007 Hansson denied to Apress the permission to use the Rails logo on the cover of a new Rails book written by some authoritative community members. The episode gave rise to a polite protest in the Rails community.[6][7] In response to this criticism, Hansson made the following claims:[8]

I only grant promotional use [of the Rails logo] for products I'm directly involved with. Such as books that I've been part of the development process for or conferences where I have a say in the execution. I would most definitely seek to enforce all the trademarks of Rails.


See also

References

External links

Wikibooks
Wikibooks has a book on the topic of

af:Ruby on Rails

ar:روبي على قضبان ca:Ruby on Rails cs:Ruby on Rails da:Ruby on Rails de:Ruby on Rails es:Ruby on Rails eo:Ruby on Rails eu:Ruby on Rails fr:Ruby on Rails gl:Ruby on Rails ko:루비 온 레일즈 it:Ruby on Rails he:Ruby on Rails hu:Ruby on Rails ms:Ruby on Rails nl:Ruby on Rails ja:Ruby on Rails no:Ruby on Rails pl:Ruby on Rails pt:Ruby on Rails ru:Ruby on Rails fi:Ruby on Rails sv:Ruby on Rails th:Ruby on Rails uk:Ruby on Rails zh-yue:Ruby on Rails

Languages
AD Links