Software:
News ToolsReg Shops |
Ruby on RailsSimpler than J2EEPublished Monday 3rd July 2006 06:32 GMT Tutorial Ruby is an object oriented scripting language. Rails is a Model-View-Controller (MVC) framework based on Ruby and used for developing web applications. An advantage of Ruby on Rails over J2EE is that it requires less code and doesn’t require any configuration files, except for a database configuration file. A Ruby on Rails web application may be developed simply with a web server and a database; and the Rails framework includes a built-in web server, WEBrick (another web server such as Apache may also be used). The Rails framework is configured for the MySQL database by default but Rails also supports PostgreSQL, SQL Server, Oracle and DB2 databases. Overview of RubyRuby is an interpreted scripting language for object-oriented programming: “interpreted” implies that a Ruby application is run without first compiling the application. Variables in Ruby do not have a type (a Ruby variable may contain data of any type). Variables in Ruby may be used without any variable declarations. Ruby, being an object oriented language, has features such as classes, inheritance and methods. Overview of RailsRails is a web application and database persistence framework for developing web applications according to the MVC pattern. Models are used to model objects in a Rails application and are typically based on The model and controller scripts may be generated with Ruby on Rails commands, some of which are discussed in the table below:
Installing Ruby on RailsIn this section we shall install the Ruby on Rails framework, and RubyGems. RubyGems is the standard Ruby package manager. Download the Ruby Windows Installer application and double-click on the ruby184-19.exe application. Ruby Setup Wizard gets started in which click on Next and accept the license agreement. Select the default components to install, which include the RubyGems package manager. Specify a directory to install Ruby, c:/ruby being the default, and click on Install. Ruby and RubyGems gets installed. Next, install Rails. From the c:/ruby directory, the directory in which Ruby is installed, run the following command to install Rails and dependencies including c:/ruby>gem install rails --include-dependencies Now install Oracle database 10g including sample schemas and create a database instance, c:/ruby>ruby ruby-oci8-0.1.15-mswin32.rb This installs the Ruby driver for the Oracle database. Next, we shall create a Rails application, c:/ruby>rails rubyrails This generates a Rails application directory structure. The root directory of the Rails application is
Track this type of story as a custom Atom/RSS feed or by email.
|
|
||||||||||||||||||||||
Top 20 stories • All The Week’s Headlines • Archive • Search