Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 58 lines (34 sloc) 1.763 kb
479ebcf Joel Moss Improved Readme
authored
1 DynamicForm
2 ===========
3
4 DynamicForm holds a few helpers method to help you deal with your Rails3 models, they are:
5
6 * `input(record, method, options = {})`
7 * `form(record, options = {})`
8 * `error_message_on(object, method, options={})`
9 * `error_messages_for(record, options={})`
10
11 It also adds `f.error_messages` and `f.error_messages_on` to your form builders.
12
22d173b Joel Moss Improved Readme - again
authored
13 Read `/lib/action_view/helpers/dynamic_form.rb` for details of each method.
14
479ebcf Joel Moss Improved Readme
authored
15 ---
16
17 DynamicErrors
18 =============
19
20 DynamicForm also includes DynamicErrors, which is a port of the custom-err-messages plugin,
21 but built to work with Rails3. It gives you the option to not have your custom validation
22 error message prefixed with the attribute name. Ordinarily, if you have, say:
23
24 validates_acceptance_of :accepted_terms, :message => 'Please accept the terms of service'
25
26 You'll get the following error message:
27
28 Accepted terms Please accept the terms of service
29
30 This plugin allows you to omit the attribute name for specific messages. All you have to do
31 is begin the message with a '^' character. Example:
32
33 validates_acceptance_of :accepted_terms, :message => '^Please accept the terms of service'
34
35 Nigel Ramsay added the ability to specify a proc to generate the message.
36
37 validates_presence_of :assessment_answer_option_id,
38 :message => Proc.new { |aa| "#{aa.label} (#{aa.group_label}) is required" }
39
40 which gives an error message like: Rate (Accuracy) is required
41
42 ---
43
44 Installation
45 ------------
46
47 DynamicForm can be installed as a gem in your `Gemfile`:
48
49 gem 'dynamic_form'
50
51 or as a plugin by running this command:
52
420c5fb Joel Moss updated URL - again!
authored
53 rails plugin install git://github.com/joelmoss/dynamic_form.git
479ebcf Joel Moss Improved Readme
authored
54
55 ---
56
57 Copyright (c) 2010 David Heinemeier Hansson, released under the MIT license
Something went wrong with that request. Please try again.