formtastic 1.2.0 → 1.2.1.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/init.rb +5 -0
  2. data/lib/formtastic.rb +3 -2
  3. data/rails/init.rb +2 -0
  4. metadata +8 -5
data/init.rb ADDED
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+ require 'formtastic'
3
+ require 'formtastic/layout_helper'
4
+ ActionView::Base.send :include, Formtastic::SemanticFormHelper
5
+ ActionView::Base.send :include, Formtastic::LayoutHelper
data/lib/formtastic.rb CHANGED
@@ -1280,16 +1280,17 @@ module Formtastic #:nodoc:
1280
1280
  input = template.check_box_tag(
1281
1281
  "#{@object_name}[#{method}]",
1282
1282
  checked_value,
1283
- (@object && @object.send(:"#{method}") == checked_value),
1283
+ (@object && @object.send(:"#{method}")),
1284
1284
  :id => field_id
1285
1285
  )
1286
+
1286
1287
  options = options_for_label(options)
1287
1288
  options[:for] ||= field_id
1288
1289
 
1289
1290
  # the label() method will insert this nested input into the label at the last minute
1290
1291
  options[:label_prefix_for_nested_input] = input
1291
1292
 
1292
- template.hidden_field_tag(method, unchecked_value) << self.label(method, options)
1293
+ template.hidden_field_tag("#{@object_name}[#{method}]", unchecked_value, :id => nil) << self.label(method, options)
1293
1294
  end
1294
1295
 
1295
1296
  # Generates an input for the given method using the type supplied with :as.
data/rails/init.rb ADDED
@@ -0,0 +1,2 @@
1
+ # encoding: utf-8
2
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "init"))
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formtastic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease: false
4
+ hash: 31098181
5
+ prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 0
10
- version: 1.2.0
9
+ - 1
10
+ - beta
11
+ version: 1.2.1.beta
11
12
  platform: ruby
12
13
  authors:
13
14
  - Justin French
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-09-08 00:00:00 +10:00
19
+ date: 2010-11-16 00:00:00 +11:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
@@ -155,8 +156,10 @@ files:
155
156
  - lib/generators/templates/formtastic.rb
156
157
  - lib/generators/templates/formtastic_changes.css
157
158
  - lib/locale/en.yml
159
+ - rails/init.rb
158
160
  - MIT-LICENSE
159
161
  - README.textile
162
+ - init.rb
160
163
  has_rdoc: true
161
164
  homepage: http://github.com/justinfrench/formtastic/tree/master
162
165
  licenses: []