Class: RubyMVC::RailsController

Inherits:
AppController show all
Defined in:
lib/ruby_mvc/controllers/rails_controller.rb

Overview

This controller is used to assist in writing Ruby applications for an existing Rails application. All of the models will be automatically loaded based on the directory configuration of the Rails environment, and the database connection environment will be used.

This controller uses the following configuration settings to help it initialize itself:

rails_app - the location of the app directory of the Rails

application

config - the default database configuration to use by

the application

Instance Attribute Summary

Attributes inherited from AppController

#app

Instance Method Summary collapse

Methods inherited from AppController

#initialize, #run

Methods included from LinkDispatcher

#link_activated

Constructor Details

This class inherits a constructor from RubyMVC::AppController

Instance Method Details

#setupObject



46
47
48
49
50
51
# File 'lib/ruby_mvc/controllers/rails_controller.rb', line 46

def setup
  @rails_app = File.expand_path(File.join(
        File.dirname(@config_file), config["rails_app"]))
  connect_db
  load_models
end