labelize 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 :country
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.0'
53
+ gem 'labelize', '0.1.3'
54
54
 
55
55
  And then run
56
56
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{labelize}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Juan Maiz"]
@@ -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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Juan Maiz