Class: MainController

Inherits:
Ramaze::Controller show all
Defined in:
lib/proto/controller/main.rb,
lib/ramaze/controller/main.rb

Overview

Default url mappings are:

a controller called Main is mapped on the root of the site: /
a controller called Something is mapped on: /something

If you want to override this, add a line like this inside the class

map '/otherurl'

this will force the controller to be mounted on: /otherurl

Constant Summary

Constants inherited from Ramaze::Controller

Ramaze::Controller::FILTER

Instance Method Summary collapse

Methods inherited from Ramaze::Controller

action_methods, at, cached, cached_action_methods, check_path, current, default, deny_layout, engine, #error, extension_order, handle, inherited, layout, map, mapping, pattern_for, raise_no_action, raise_no_controller, raise_no_filter, relevant_ancestors, resolve, resolve_action, resolve_method, resolve_template, startup, template, template_paths, template_root, view_root

Methods included from Ramaze::Helper::Methods

extend_object, #helper, included

Instance Method Details

#indexObject

the index action is called automatically when no other action is specified



12
13
14
# File 'lib/proto/controller/main.rb', line 12

def index
  @title = "Welcome to Ramaze!"
end

#notemplateObject

the string returned at the end of the function is used as the html body if there is no template for the action. if there is a template, the string is silently ignored



19
20
21
# File 'lib/proto/controller/main.rb', line 19

def notemplate
  "there is no 'notemplate.xhtml' associated with this action"
end