eucalypt
>= 0.9.0
>= 0.9.0
  • eucalypt
  • Installation
  • CLI
    • Core
      • Init
      • Launch
      • Console
      • Test
      • Version
      • Rake
      • Help (-H)
    • Generate
      • Controller
      • Helper
      • Model
      • Scaffold
    • Destroy
      • Controller
      • Helper
      • Model
      • Scaffold
    • Blog
      • Setup
      • Article
        • List
        • Generate
        • Destroy
        • Edit
          • Urltitle
          • Datetime
    • Migration
      • Blank
      • Types
      • Create
        • Table
      • Add
        • Index
        • Column
      • Drop
        • Table
        • Index
        • Column
      • Rename
        • Table
        • Index
        • Column
      • Change
        • Column
  • Features
    • Controllers
    • Helpers
    • Views
      • Layouts
      • Partials
    • Static data
    • Core application file
    • Configuration
      • Logging
      • Asset pipeline
        • Manifest asset files
      • Initializers
      • Database
    • Manifest accessor
    • Application path helpers
    • Blog environment
      • Articles
    • Rendering static files
    • Maintenance mode
Powered by GitBook
On this page
  • Location
  • Contents
  • Defining routes
  1. Features

Core application file

The core application file contains the main configurations for your application, as well as require directives to various parts of your applications.

PreviousStatic dataNextConfiguration

Last updated 6 years ago

Location

The core application file can be found at app.rb.

Contents

The core application file contains the configurations for:

  • The server used to run the application

  • The default directory to look for views in

  • The default view template to use for ERB

  • The application root directory

  • HTML and asset helpers

Defining routes

Routes should generally not be defined in ApplicationController unless they are intended to be accessible by every other controller, which is rarely the case (apart from error routes like error Sinatra::NotFound do ... end, which should typically redirect to a /404 route defined in MainController).

Core application routes such as the index / should instead be defined in MainController.

Alternatively, you can .

generate a new controller