labelize 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/VERSION +1 -1
- data/labelize.gemspec +1 -1
- data/lib/labelize.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -16,7 +16,7 @@ First, define the label of your model (it _must_ be a String column):
|
|
16
16
|
Now you are free of "collects" or "collection_select". Look:
|
17
17
|
|
18
18
|
- form_for(@state) do |f|
|
19
|
-
= f.select :
|
19
|
+
= f.select :country_id
|
20
20
|
|
21
21
|
You can do that:
|
22
22
|
|
@@ -50,7 +50,7 @@ It works out-of-the-box with inherited_resources and i think it can be used with
|
|
50
50
|
|
51
51
|
Just add this to your Gemfile (assuming your source is RubyForge)
|
52
52
|
|
53
|
-
gem 'labelize', '0.1.
|
53
|
+
gem 'labelize', '0.1.3'
|
54
54
|
|
55
55
|
And then run
|
56
56
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/labelize.gemspec
CHANGED
data/lib/labelize.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class ActionView::Helpers::FormBuilder
|
2
2
|
def select(method, choices=nil, options = {}, html_options = {})
|
3
|
-
choices ||= method.to_s.camelize.constantize.options
|
3
|
+
choices ||= method.to_s.gsub('_id','').camelize.constantize.options
|
4
4
|
@template.select(@object_name, method, choices, options.merge(:object => @object), html_options)
|
5
5
|
end
|
6
6
|
end
|