Layouts

When you install Rapid Rails Themes, it's going to create the followign files in your app/views/layouts directory:

app/views/layouts/
├── _app_nav.html.erb
├── _base.html.erb
├── _dashboard_top_nav.html.erb
├── _external_js_libs.html.erb
├── _flashes.html.erb
├── _side_menu.html.erb
├── _side_menu_header.html.erb
├── _side_menu_main_content.html.erb
├── application.html.erb
├── devise.html.erb
├── email.html.erb
├── landing.html.erb
├── scaffold.html.erb
└── sidenav.html.erb

Base Partial Layout

This is the layout from which all things inherit. It's the main wrapper providing the page with enhanced functionality such as:

  • External JS loading
  • body tag classes and JS lib feature declaration

Application Layout

Inherits the base layout, and simply renders _flashes before yielding. It is the most minimal of usable layouts.

Devise Layout

Inherits the base layout before yielding to Devise.

Landing Layout

Inherits the base layout before yielding to the page.

Email Layout

Provides a cusomized Email mailer layout.

Scaffold Layout

Inherits from _app_nav partial layout, and provides some hooks for the header seen in the online demo, which has areas for a title and action buttons, and Flashes.

Sidenav Layout

Inherits from _base and renders out the _side_menu partials, _dashboard_top_nav partial, Flashes and then yields the page to a main-content area.

_app_nav Layout

App Nav provides a pre-coded general App type header bar suitable for your internal App pages.

_dashboard_top_nav Layout

Dashboard Top Nav provides a pre-coded general App type header bar suitable for your internal App pages, which is designed to be used with the Sidenav layout. It contains a button and JS hook for opening and closing the sidenav.

_external_js_libs Layout

This is a special layout partial which has special hooks that listen to the contents of the @js_libs instance variable, and based on the content makes explicity Javascript inlcudes. The idea here is that when you have large JS libs that you don't want included in your main appplication.js bundle, you can list them in ehere and only have them loaded when set. This is ideal for large JS libs that are only needed on certain pages.

For example, in the online demo, the Google Maps functionality is only loaded on certain pages, in response to the @js_libs instance variable containing the 'gmaps' string.

_flashes Layout

Contains the Rails Flashes output. That's it!