Rails Concepts

Directory Structure

./app - Main application directory

Other important files for development

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

Example:

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

end

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.

External Resources