Skip to content

Commit

Permalink
Merge pull request #5 from Schultzer/fix-doc-example-and-add-examples…
Browse files Browse the repository at this point in the history
…-to-readme

Add example of currency_select to readme and fix doc examples
  • Loading branch information
kipcole9 authored Nov 1, 2020
2 parents dfd41a0 + 78ccc62 commit 281cc8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ HTML helper functions for CLDR.

* [Not Implemented] Select days of the week and months of the year in a given locale

## Examples

```elixir
iex> import Phoenix.HTML
iex> safe_to_string Cldr.HTML.Currency.select(:my_form, :currency, selected: :USD, currencies: ~w(usd eur jpy cop))
"<select id=\"my_form_currency\" name=\"my_form[currency]\" selected=\"USD\"><option value=\"COP\">COP - Colombian Peso</option><option value=\"EUR\">EUR - Euro</option><option value=\"JPY\">JPY - Japanese Yen</option><option value=\"USD\">USD - US Dollar</option></select>"
```

## Installation

`CldrHtml` can be installed by adding `ex_cldr_html` to your list of dependencies in `mix.exs`:
`Cldr.HTML` can be installed by adding `ex_cldr_html` to your list of dependencies in `mix.exs`:

```elixir
def deps do
Expand Down

0 comments on commit 281cc8f

Please sign in to comment.