Class: MainController

Inherits:
Controller show all
Defined in:
lib/proto/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::CONTROLLER_LIST, Ramaze::Controller::IRREGULAR_MAPPING

Instance Method Summary collapse

Methods inherited from Ramaze::Controller

app, engine, generate_mapping, inherited, map, mapping, options, setup, setup_procedure

Instance Method Details

#indexObject

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



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

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



20
21
22
23
24
# File 'lib/proto/controller/main.rb', line 20

def notemplate
  @title = 'Welcome to Ramaze!'
  
  return 'There is no \'notemplate.xhtml\' associated with this action.'
end