Organizing Controllers using Namespaces

Your project may have many controllers, and some of them may perform similar functions. You can group controllers into namespaces as a way of organizing them. In 3rdRail you do this when you create the controller.

To create a controller and assign its namespace:

  1. Open the
    New Controller Wizard New Rails Project Wizard
    File | New | Rails Controller.
  2. When you type the name of the controller, use the Rails syntax that includes a namespace:
    {namespace_name}/{controller_name}
  3. Complete the steps in the Controller Wizard.

To create a controller using the Rails Console, type:

script/generate controller {namespace_name}/{controller_name}

Corporate LogoCodeGear brand and product names are service marks, trademarks or registered trademarks of Borland Software Corporation in the United States and other countries.