Rails Concepts

Directory Structure

./app - Main application directory

  • ./app/models - Models

  • ./app/controllers - Controllers

  • ./app/views - Views

    • ./views/layouts/application.html.erb HTML page wrapper
      • Includes top navigation menu, etc. Other views are injected here.
  • ./app/assets/ - Images, stylesheets, and JavaScript files

    • ./app/assets/javascripts
    • ./app/assets/stylesheets
    • ./app/assets/images/

Other important files for development

./config/routes.rb - Contains mappings between URL links and controller actions


get 'example' => "example#test_action"

This will route the url: example to the method test_action in our controller named ExampleController Note that we refer to the controller without the appended Controller

./log/development.log - Development log

./Gemfile - File that contains gems to be included in the rails application

More information on directory structure.

Naming Conventions

One of the primary Rails mantras is Convention over Configuration.

As such, proper naming convention is extremely important. Rails uses a combination of CamelCase and snake_case. Filenames within the models and controllers directory must be a snake_cased version of the class (either the model or controller).

Controller Example:

class DemoController < ApplicationController


must be in a file named ./app/controllers/demo_controller.rb (for consistency, we append all controllers with 'Controller')

SDK Concepts

Creating Queries

Reference an SDK Class using Java::HarbingerSDkData::SDK_CLASS_NAME

Java::HarbingerSdkData::RadExamFact, for example. To create a query, simply use the createQuery method on an SDK Class.

When performing queries in an application, you should pass an entity manager to get the best performance possible.

See query examples for more information

Linux (bash) Commands

For executing files, ./ refers to the current location to specify a file. Typing the filename and then hitting enter will execute the given file. This is the equivalent of double-clicking an executable in Windows.

  • Run server or console
    • ./launch_dev_server
    • ./launch_dev_console
  • Copy files (specify 'from' and 'to')
    • cp /servers/dev/harbinger-sdk-1.7.0-standalone.jar ./sdk/
  • Change directory
    • cd /servers/dev/

External Resources