From a52962905f487b7af1d0006a0945ad956518105f Mon Sep 17 00:00:00 2001 From: Dave Shaffer Date: Mon, 6 Jun 2016 14:58:00 -0400 Subject: [PATCH] Add label_method info in README From @rafaelfranca's StackOverflow post here: http://stackoverflow.com/questions/6334582/simple-form-association-custom-label-name/6335679#6335679 --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcec2811..49a5dacb 100644 --- a/README.md +++ b/README.md @@ -323,8 +323,9 @@ Collection inputs accept two other options beside collections: Those methods are useful to manipulate the given collection. Both of these options also accept lambda/procs in case you want to calculate the value or label in a special way eg. custom -translation. All other options given are sent straight to the underlying helper. For example, you -can give prompt as: +translation. You can also define a `to_label` method on your model as **Simple Form** will search for +and use `:to_label` as a `:label_method` first if it is found. All other options given are sent +straight to the underlying helper. For example, you can give prompt as: ```ruby f.input :age, collection: 18..60, prompt: "Select your age", selected: 21