Rails provide us with some excellent tools that are used to develop the Rails application. These tools are packaged as scripts from the command line. Ruby on Rails Training provides basic and advanced concepts of Ruby. Our Ruby programming tutorial is designed for beginners and professionals both.
Following are the most useful Rails scripts used in Rails applications:
Rails ConsoleWEBrick Web ServerGeneratorsMigrationsRails Console
The Rails console is a command-line utility that runs the Rails applications from the command line. The Rails console is an extension of Ruby IRB. It provides all the features of IRB together with the ability to the auto-load Rails application environment, including all its classes and components. It helps you to walk through your application step by step.
WEBrick Web server
Rails are configured to automatically use the WEBrick server. This server is written in pure Ruby and supports the majority of platforms like Windows, Mac, or Unix. Alternatively, if you have Mongrel or Lighttpd server installed in your system, Rails uses either of those servers.
All the three Rails servers feature automatic reloading of code. It means, that when you change your source code, you do not need to restart the server.
Generators
The Rails include code generation scripts, which are used to automatically generate model and controller classes for an application. Code generation increases your productivity when developing Web applications. By running the generator command, skeleton files for all of your model and controller classes will be generated. It also generates database migration files for each model it generates.
Migrations
Migrations bring the Rails DRY feature to life. It's a pure Ruby code that defines the structure of a database. You do not have to use SQL to write your code while using migration.
The changes you make to your database schema are isolated during a separate migration file, which has a method to implement or reverse the change.
Sign in to leave a comment.