formula 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/formula.rb +20 -6
- metadata +3 -3
data/lib/formula.rb
CHANGED
@@ -99,7 +99,6 @@ module Formula
|
|
99
99
|
# * :error - override the default error used ('invalid', 'incorrect', etc.)
|
100
100
|
# * :input - add custom options to the input ({ :class => 'goregous' }, etc.)
|
101
101
|
# * :container - add custom options to the container ({ :class => 'gorgeous' }, etc.)
|
102
|
-
# * :collection -
|
103
102
|
#
|
104
103
|
# Usage:
|
105
104
|
#
|
@@ -164,13 +163,28 @@ module Formula
|
|
164
163
|
#
|
165
164
|
# Options:
|
166
165
|
#
|
167
|
-
# * :
|
168
|
-
# * :
|
169
|
-
# * :
|
170
|
-
# * :
|
166
|
+
# * :label - override the default label used ('Name:', 'URL:', etc.)
|
167
|
+
# * :error - override the default error used ('invalid', 'incorrect', etc.)
|
168
|
+
# * :association - add custom options to the input ({ :class => 'goregous' }, etc.)
|
169
|
+
# * :container - add custom options to the container ({ :class => 'gorgeous' }, etc.)
|
170
|
+
#
|
171
|
+
# Usage:
|
172
|
+
#
|
173
|
+
# f.association(:category_id, Category.all, :id, :name, :hint => "What do you do?")
|
174
|
+
#
|
175
|
+
# Equivalent:
|
176
|
+
#
|
177
|
+
# <div>
|
178
|
+
# <div class="association">
|
179
|
+
# <%= f.label(:category_id)
|
180
|
+
# <%= f.collection_select(:category_id, Category.all, :id, :name)
|
181
|
+
# <div class="hint">What do you do?</div>
|
182
|
+
# </div>
|
183
|
+
# </div>
|
171
184
|
|
172
|
-
def association(method, options = {}
|
185
|
+
def association(method, collection, value, text, options = {})
|
173
186
|
self.block(method, options) do
|
187
|
+
collection_select(method, collection, value, text)
|
174
188
|
end
|
175
189
|
end
|
176
190
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 8
|
9
|
+
version: 0.0.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kevin Sylvestre
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-11-
|
17
|
+
date: 2010-11-14 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|