# _M.rails

The rails module.
It provides utilities for editing Ruby on Rails code.

## Key Bindings

+ `Ctrl+L, M` (`⌘L, M` on Mac OSX | `M-L, M` in curses)
  Open this module for editing.
+ `Ctrl+L, P` (`⌘L, P` | `M-L, P`)
  Open a Rails project for snapopen.
+ `Ctrl+L, O` (`⌘L, O` | `M-L, O`)
  Snapopen a Rails project file.
+ `Shift+Enter` (`⇧↩` | `S-Enter`)
  Try to autocomplete an `if`, `while`, `for`, etc. control structure with
  `end`.
+ `.`
  When to the right of a known symbol, show an autocompletion list of fields
  and functions.
+ `::`
  When to the right of a known symbol, show an autocompletion list of fields
  and functions.

- - -

## Fields

- - -

<a id="sense"></a>
### `sense` 

The Rails [Adeptsense](_M.textadept.adeptsense.html).
  It loads user tags from *`_USERHOME`/modules/rails/tags* and user apidocs
  from *`_USERHOME`/modules/rails/api*.

- - -

<a id="singular"></a>
### `singular` 

A map of plural controller names to their singulars. Add key-value pairs to
  this if the local function `singularize()` is incorrectly converting your
  plural controller name to its singular model name.

- - -


## Functions

- - -

<a id="load_project"></a>
### `load_project`(*utf8\_dir*)

Opens a Rails project for snapopen.
If not directory is provided, the user is prompted for one.

Parameters:

* *`utf8_dir`*: The UTF-8 Rails project directory.

- - -


## Tables

- - -

<a id="_G.keys.rails"></a>
### `_G.keys.rails`

Container for Rails-specific key bindings.

- - -

<a id="_G.snippets.rails"></a>
### `_G.snippets.rails`

Container for Rails-specific snippets.

- - -

