formulate 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -46,13 +46,17 @@ module Formulate
46
46
  errors = errors_on(method)
47
47
 
48
48
  classes = ['field']
49
- classes << (options.delete(:required) ? 'required' : 'optional')
49
+ classes << (options[:required] ? 'required' : 'optional')
50
50
  classes << 'checkbox' if type == :check_box
51
51
  classes << 'radio' if type == :radio_button
52
52
  classes << 'error' if errors.any?
53
53
  classes << options.delete(:class) if options[:class]
54
54
  classes.uniq!
55
55
 
56
+ if options[:placeholder] == true
57
+ options[:placeholder] = object.class.human_attribute_name(method)
58
+ end
59
+
56
60
  input = case type
57
61
  when :check_box
58
62
  checked_value = options.delete(:checked_value)
@@ -4,7 +4,9 @@ module Formulate
4
4
 
5
5
  def form_for(record, options={}, &proc)
6
6
  options[:html] ||= {}
7
- options[:html][:class] ||= 'formulate'
7
+ apply_form_for_options!(record, options)
8
+ options[:html][:class] << ' formulate'
9
+ options[:html][:class] << " #{options[:class]}" if options[:class]
8
10
 
9
11
  original_field_error_proc = ::ActionView::Base.field_error_proc
10
12
  ::ActionView::Base.field_error_proc = FIELD_ERROR_PROC
@@ -1,3 +1,3 @@
1
1
  module Formulate
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formulate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-19 00:00:00.000000000 Z
12
+ date: 2012-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 1.8.24
134
+ rubygems_version: 1.8.23
135
135
  signing_key:
136
136
  specification_version: 3
137
137
  summary: Rails form builder with flexible markup and styles.