_M.rails - Textadept API

# Textadept

- Home |
- Download |
- Lua API |
- Source |
- Language Modules |
- Stats |
- Wiki |
- Mailing List

# _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

### `sense`

The Rails Adeptsense. It loads user tags from `_USERHOME`/modules/rails/tags and user apidocs from `_USERHOME`/modules/rails/api.

### `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

### `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

### `_G.keys.rails`

Container for Rails-specific key bindings.

### `_G.snippets.rails`

Container for Rails-specific snippets.