Skip to content

Commit

Permalink
Merge branch 'master' into rails3
Browse files Browse the repository at this point in the history
Conflicts:
	formtastic.gemspec
	lib/formtastic.rb
  • Loading branch information
Morton Jonuschat committed Jul 22, 2010
2 parents 038357c + fbd0a61 commit aea2b6f
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 32 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
(HEAD)
* Changed semantic_remote_form_for to allow for unobstrusive javascript / :remote option (rails3)
* Changed spec_helper to support Rails 2 with Rspec od Rails 3 with Rspec 3 environments
* 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
* Fixed use of model_name.human instead of model_name.human_name (rails3)
* Fixed use of deprecated Errors#on_base
* Added railtie to perform initialization tasks after the rails git framework is available (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.beta2 (unreleased)

* Added default escaping of html entities in labels and hints (#292, #299)
* Added/Fixed that :value_method and :label_method were not being used for simple collections (like Arrays)
* Added some more compatibility for Mongooid and other ORMs by checking for reflection information before calling it
* Fixed deprecation warnings in Rails 2.3.6 and newer
* Fixed a bug where :check_boxes and :radio were using method instead of :label option
* Fixed a conflict where i18n lookups were failing when an attribute and model have the same name
* Fixed some html that was not marked as safe

1.0.0.beta

Expand Down
44 changes: 28 additions & 16 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,33 @@ h2. Documentation
RDoc documentation _should_ be automatically generated after each commit and made available on the "rdoc.info website":http://rdoc.info/projects/justinfrench/formtastic.


h2. Installation
h2. A Note About Rails 3 Support

The gem is hosted on gemcutter, so *if you haven't already*, add it as a gem source:
Formtastic 1.0 will only support the latest stable Rails 2.x. We're maintaining a rails3 branch which aims to provide both Rails 2.x and 3.x support, which is targeted for the 1.1 release soon after 1.0, around the same time Rails 3.0 ships.

If you have a Rails 3 project and would like to use Formtastic's rails3 branch, bundler provides you with the ability to do this easily. Just add Formtastic as a git dependency in your Gemfile with the :branch option:

<pre>
sudo gem sources -a http://gemcutter.org/
gem 'formtastic', :git => "http://github.com/justinfrench/formtastic.git", :branch => "rails3"
</pre>

Then install the Formtastic gem:
Please be aware that Rails 3 is still under heavy development (even in the later betas), as is Formtastic, so our rails3 branch is very much "on the edge", just like Rails. if you find issues, compatibility issues with Rails 2 or 3, please report an issue on Github.


h2. Installation under Rails 2.x

Install the Formtastic gem:

<pre>
sudo gem install formtastic
</pre>

Or try the 1.0.0.beta2:

<pre>
sudo gem install formtastic --pre
</pre>

And add it to your environment.rb configuration as a gem dependency:

<pre>
Expand All @@ -113,6 +126,7 @@ A proof-of-concept stylesheet is provided which you can include in your layout.
</head>
</pre>


h2. Usage

Forms are really boring to code... you want to get onto the good stuff as fast as possible.
Expand Down Expand Up @@ -524,9 +538,11 @@ By default formtastic escapes html entities in both labels and hints unless a st
Formtastic::SemanticFormBuilder.escape_html_entities_in_hints_and_labels = false


h2. Status
h2. Focus

Formtastic has been in active development for about a year. We've just recently jumped to an 0.9 version number, signaling that we consider this a 1.0 release candidate, and that the API won't change significantly for the 1.x series.
Formtastic is close to shipping a 1.0 release candidate after more than a year of active development. 1.0 will be compatible with Rails 2, and this is our top priority right now. We've also been working hard on a Rails 2 *and* 3 compatible version in the rails3 branch, targeting a 1.1 release shortly after Rails 3.0 ships.

There's heaps more we want to do, but we have to do this first.


h2. Dependencies
Expand All @@ -540,18 +556,14 @@ There are none, but...

h2. Compatibility

I'm only testing Formtastic with the latest Rails 2.4.x stable release, and it should be fine under Rails 2.3.x as well (including nested forms). Patches are welcome to allow backwards compatibility, but I don't have the energy!

h2. Got TextMate?

Well...there's a TextMate-bundle in town, dedicated to make usage of Formtastic in the "TextMate":http://macromates.com/ editor even more of a breeze:

"Formtastic.tmbundle":http://github.com/grimen/formtastic_tmbundle

* We're only testing Formtastic with the latest Rails 2.x stable release. Patches are welcome to allow backwards compatibility with older versions of Rails, of course.
* Development of a Rails 2 *and* 3 compatible version of Formtastic is underway in the rails3 branch, targeting a Formtastic 1.1 release shortly after Rails 3.0 ships.
* Formtastic, much like Rails 2, is very ActiveRecord-centric. Many people are using Formtastic (especially the rails3 branch) successfully with other ActiveModel-like ORMs and classes (DataMapper, MongoMapper, Mongoid, Authlogic, Devise...) but we're not guaranteeing anything at this stage. Patches are welcome, but it's not our core focus right now. Shipping a solid 1.0 and Rails 3 compatible 1.1 is.


h2. How to contribute

*Before you send a pull request*, please ensure that you provide appropriate spec/test coverage and ensure the documentation is up-to-date. Bonus points if you perform your changes in a clean topic branch rather than master.
Please ensure that you provide appropriate spec/test coverage and ensure the documentation is up-to-date. Bonus points if you perform your changes in a clean topic branch rather than master, and if you create an issue on GH for us to discuss your changes. Pull requests tend to get lost.

Please also keep your commits *atomic* so that they are more likely to apply cleanly. That means that each commit should contain the smallest possible logical change. Don't commit two features at once, don't update the gemspec at the same time you add a feature, don't fix a whole bunch of whitespace in a file at the same time you change a few lines, etc, etc.

Expand All @@ -560,7 +572,7 @@ For significant changes, you may wish to discuss your idea on the Formtastic Goo

h2. Maintainers & Contributors

Formtastic is maintained by "Justin French":http://justinfrench.com, "José Valim":http://github.com/josevalim and "Jonas Grimfelt":http://github.com/grimen, but it wouldn't be as awesome as it is today without help from over 40 contributors.
Formtastic is maintained by "Justin French":http://github.com/justinfrench, "Morton Jonuscha":http://github.com/yabawock and "Gabriel Sobrinho":http://github.com/sobrinho. "Denis Major":http://github.com/denismajor1 is doing some amazing documentation work in the wiki, and we very much appreciate the past efforts of "José Valim":http://github.com/josevalim and "Jonas Grimfelt":http://github.com/grimen and over 40 other contributors.

@git shortlog -n -s --no-merges@

Expand Down
6 changes: 2 additions & 4 deletions RELEASE_PROCESS
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ rake version:bump:minor # or patch or major, commits the change
rake gemspec # to generate the new gemspec file
git add formtastic.gemspec # stage changes
git commit -am "new gemspec" # commit and describe the reason for the new gem
git tag -am "0.2.3" 0.2.3 # tag the new version in the code base too
git log 0.2.2..0.2.3 # check the log since last tag
git tag 0.2.3 # tag the new version in the code base too
gem build formtastic.gemspec # build the gem
gem push formtastic-0.2.3.gem # publish the gem
git push # push to github
git push --tags # push the tags up to remote too
git push && git push --tags # push to remote
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: beta
:build: beta2
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.beta"
s.version = "1.0.0.beta2"

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-06-30}
s.date = %q{2010-07-21}
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
12 changes: 5 additions & 7 deletions lib/formtastic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1790,9 +1790,7 @@ def escape_html_entities(string) #:nodoc:
module SemanticFormHelper
@@builder = ::Formtastic::SemanticFormBuilder
mattr_accessor :builder

@@default_field_error_proc = nil


# Override the default ActiveRecordHelper behaviour of wrapping the input.
# This gets taken care of semantically by adding an error class to the LI tag
# containing the input.
Expand All @@ -1802,11 +1800,11 @@ module SemanticFormHelper
end

def with_custom_field_error_proc(&block)
@@default_field_error_proc = ::ActionView::Base.field_error_proc
default_field_error_proc = ::ActionView::Base.field_error_proc
::ActionView::Base.field_error_proc = FIELD_ERROR_PROC
result = yield
::ActionView::Base.field_error_proc = @@default_field_error_proc
result
yield
ensure
::ActionView::Base.field_error_proc = default_field_error_proc
end

def semantic_remote_form_for_wrapper(record_or_name_or_array, *args, &proc)
Expand Down

0 comments on commit aea2b6f

Please sign in to comment.