# elm-rails-routes

> Generate an Elm routes module from Rails

Latest version **1.0.2** (published 2018-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install elm-rails-routes
pnpm add elm-rails-routes
yarn add elm-rails-routes
bun add elm-rails-routes
```

Provides the command `elm-rails-routes`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-03-09 |
| First published | 2018-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | kirchner |

## Links

- npm: https://www.npmjs.com/package/elm-rails-routes
- Repository: https://github.com/phrase/elm-rails-routes
- Homepage: https://github.com/phrase/elm-rails-routes#readme
- Issues: https://github.com/phrase/elm-rails-routes/issues
- npm.io page: https://npm.io/package/elm-rails-routes

## Dependencies (2)

- [yargs](https://npm.io/package/yargs.md) ^11.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1

## Recent versions

- 1.0.2 (latest) — 2018-03-09
- 1.0.1 — 2018-03-09
- 1.0.0 — 2018-03-09

## README

# elm-rails-routes

This program generates small path helper functions for Elm from the output of `rails routes`.


## Usage

First run the following command in your Rails root:

```
$ rails routes > routes
```

Then run

```
$ elm-rails-routes init
$ elm-rails-routes generate-elm
```

This will create an Elm module under `src/Routes.elm` which content looks
something like this (depending on your actual rails routes):

```elm
module Routes exposing (..)

import Http


users : String
users =
    [ "users"
    ]
        |> String.join "/"
        |> String.append "/"

user : String -> String
user id =
    [ "users"
    , Http.encodeUri id
    ]
        |> String.join "/"
        |> String.append "/"

...
```


## Configuration

Take a loot at `elm-rails-routes.json` to adjust the configuration.

---
_Source: https://npm.io/package/elm-rails-routes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
