Category: 5. Ruby on Rails

  • Ruby on Rails AJAX

    AJAX Introduction AJAX stands for Asynchronous Javascript and XML. It is a mixture of several technologies and is an important part of Rails application. It allows client side changes without reloading the page. Let us see the working of a normal web server. On typing a web address and clicking on search, the browser makes…

  • Rails Validation

    Rails validation defines valid states for each of your Active Record model classes. They are used to ensure that only valid details are entered into your database. Rails make it easy to add validations to your model classes and allows you to create your own validation methods as well. Using built-in validation DSL, you can…

  • Testing in Rails

    Rails test is very simple to write and run for your application. As Rails script generates models and controllers, in the same way test files are also generated. Rails also uses a separate database for testing. Test database in an application is rebuilt each time the application’s test run, and hence you always have a…

  • Rails Filters

    Rails filters are methods that run before or after a controller’s action method is executed. They are helpful when you want to ensure that a given block of code runs with whatever action method is called. Rails support three types of filter methods: Before Filters Rails before filters are executed before the code in action…

  • Rails Layout

    In Rails, layouts are pieces that fit together (for example header, footer, menus, etc) to make a complete view. An application may have as many layouts as you want. Rails use convention over configuration to automatically pair up layouts with respective controllers having same name. Rails layouts basically work on Don’t Repeat Yourself principle (DRY).…

  • Ruby on Rails Scaffolding

    Scaffolding Scaffolding is a quick way to produce some major pieces of an application. For auto generating a set of models, views and controllers for a new resource in a single operation, scaffolding is used. Scaffolding is a technique supported by MVC frameworks in which programmers can specify how application database may be used. The…

  • Ruby on Rails Router

    The Rails router recognizes URLs and dispatches them to a controller’s action. It also generate paths and URLs. Rails router deals URLs in a different way from other language routers. It determines controller, parameters and action for the request. Basically a router is a way to redirect incoming requests to controllers and actions. It replaces…

  • Ruby on Rails Migrations

    Migrations are a way to alter database schema over time in a consistent and organized manner. They use a Ruby DSL through which there is no need to write SQL by hand. SQL fragments can be edited by hand but then you have to tell other developers about the changes you made and then run…

  • Ruby on Rails Bundler

    In Rails, bundler provides a constant environment for Ruby projects by tracking and installing suitable gems that are needed. It manages an application’s dependencies through its entire life, across many machines, systematically and repeatably. To use bundler, you need to install it. The gem bundler bundles all the suitable gems your appication is based upon.…

  • Ruby on Rails RVM

    RVM stands for Ruby Version Manager. It is a command line tool which allows you to easily install, manage and work with different Ruby environments. With RVM, you can easily install different versions of Ruby and easily switch between them. RVM is maintained by the github community through pull requests sent to the project repository.…