formula 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Kevin Sylvestre
1
+ Copyright (c) 2010 - 2011 Kevin Sylvestre
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -1,10 +1,10 @@
1
1
  = Formula
2
2
 
3
- Formula is a Rails form generator that generates simple clean markup. The project aims to let users create semantically beautiful forms without introducing too much syntax. The goal is to make integrating advanced layout systems (such as grid systems) as simple as possible.
3
+ Formula is a Rails form helper that generates awesome markup. The project aims to let users create semantically beautiful forms without introducing too much syntax. The goal is to make integrating advanced layout systems (such as grid systems) as simple as possible.
4
4
 
5
5
  == Requirements
6
6
 
7
- The gem has only been tested with Ruby 1.9.2 and Rails 3.0.3 but may well work with other versions of Ruby and Rails.
7
+ The gem is tested with Ruby 1.9.2 and Rails 3.0.6 but may well work with other versions of Ruby and Rails.
8
8
 
9
9
  == Installation
10
10
 
@@ -52,4 +52,4 @@ The gem has only been tested with Ruby 1.9.2 and Rails 3.0.3 but may well work w
52
52
 
53
53
  == Copyright
54
54
 
55
- Copyright (c) 2010 Kevin Sylvestre. See LICENSE for details.
55
+ Copyright (c) 2010 - 2011 Kevin Sylvestre. See LICENSE for details.
data/lib/formula.rb CHANGED
@@ -179,6 +179,7 @@ module Formula
179
179
  def input(method, options = {})
180
180
  options[:as] ||= as(method)
181
181
  options[:input] ||= {}
182
+ options[:input][:html] ||= {}
182
183
 
183
184
  self.block(method, options) do
184
185
  @template.content_tag(::Formula.input_tag, :class => [::Formula.input_class, options[:as]]) do
@@ -192,9 +193,10 @@ module Formula
192
193
  when :email then email_field method, options[:input]
193
194
  when :phone then phone_field method, options[:input]
194
195
  when :number then number_field method, options[:input]
195
- when :date then date_select method, options[:input]
196
- when :time then time_select method, options[:input]
197
- when :datetime then datetime_select method, options[:input]
196
+ when :date then date_select method, options[:input], options[:input][:html]
197
+ when :time then time_select method, options[:input], options[:input][:html]
198
+ when :datetime then datetime_select method, options[:input], options[:input][:html]
199
+ when :select then select method, options[:choices], options[:input], options[:input][:html]
198
200
  end
199
201
  end
200
202
  end
@@ -348,7 +350,8 @@ module Formula
348
350
  # representation.
349
351
 
350
352
  def error(method)
351
- @object.errors[method].to_sentence
353
+ errors = @object.errors[method] if @object
354
+ errors.to_sentence if errors
352
355
  end
353
356
 
354
357
 
@@ -1,3 +1,3 @@
1
1
  module Formula
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: formula
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.4
5
+ version: 0.2.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kevin Sylvestre
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-23 00:00:00 -05:00
13
+ date: 2011-05-17 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  requirements: []
56
56
 
57
57
  rubyforge_project:
58
- rubygems_version: 1.5.0
58
+ rubygems_version: 1.6.2
59
59
  signing_key:
60
60
  specification_version: 3
61
61
  summary: A great way to simplify complex forms