1.0.2 • Published 6 years ago

elm-rails-routes v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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):

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.

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago