Skip to content

Commit

Permalink
Merge branch 'master' into rails3
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG
	formtastic.gemspec
	spec/inputs/boolean_input_spec.rb
  • Loading branch information
mjonuschat committed Aug 1, 2010
2 parents 6c3a884 + ce2b08a commit e5c42d0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
* Changed semantic_remote_form_for to allow for unobstrusive javascript / :remote option (rails3)
* Changed spec_helper to support Rails 2 with RSpec or Rails 3 with RSpec 2 environments
* Changed Rakefile to initalize the correct testing framework for the enviroment
* Changed i18n dependency to >= 0.4
* Fixed use of model_name.human instead of model_name.human_name (rails3)
* Fixed use of deprecated Errors#on_base
* Fixed use of ActionController::RecordIdentifier#singular_class_name (rails3)
* Added railtie to perform initialization tasks after the rails framework is available (rails3)
* Added compatible install and form helpers (rails3)
* Added support for ActiveModel Validations, thanks to Guillaume Belleguic (rails3)

1.0.0.beta4

* ensure i18n < 0.4 is listed as a dependency in the gemspec

1.0.0.beta3

* Added :ignore_date option to time inputs (#308)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
:major: 1
:minor: 0
:patch: 0
:build: beta3
:build: rc
4 changes: 2 additions & 2 deletions formtastic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

Gem::Specification.new do |s|
s.name = %q{formtastic}
s.version = "1.0.0.beta3"
s.version = "1.0.0.rc"

s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Justin French"]
s.date = %q{2010-07-29}
s.date = %q{2010-08-01}
s.description = %q{A Rails form builder plugin/gem with semantically rich and accessible markup}
s.email = %q{[email protected]}
s.extra_rdoc_files = [
Expand Down
4 changes: 3 additions & 1 deletion lib/formtastic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1259,9 +1259,11 @@ def boolean_input(method, options)
html_options = options.delete(:input_html) || {}
checked = options.key?(:checked) ? options[:checked] : options[:selected]
html_options[:checked] = checked == true if [:selected, :checked].any? { |k| options.key?(k) }
checked_value = options.delete(:checked_value) || '1'
unchecked_value = options.delete(:unchecked_value) || '0'

input = self.check_box(method, strip_formtastic_options(options).merge(html_options),
options.delete(:checked_value) || '1', options.delete(:unchecked_value) || '0')
checked_value, unchecked_value)
options = options_for_label(options)

# the label() method will insert this nested input into the label at the last minute
Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/boolean_input_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
end

output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form li label input[@type="checkbox"][@value="checked"]')
output_buffer.should have_tag('form li label input[@type="checkbox"][@value="checked"]:not([@unchecked_value][@checked_value])')
output_buffer.should have_tag('form li label input[@type="hidden"][@value="unchecked"]')
end

Expand Down

0 comments on commit e5c42d0

Please sign in to comment.