padrino-helpers 0.2.6 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.9
@@ -95,7 +95,7 @@ module Padrino
95
95
  # Returns the object's models name
96
96
  # => user_assignment
97
97
  def object_name
98
- object.is_a?(Symbol) ? object : object.class.to_s.underscore
98
+ object.is_a?(Symbol) ? object : object.class.to_s.underscore.gsub('/', '-')
99
99
  end
100
100
 
101
101
  # Returns true if the value matches the value in the field
@@ -83,8 +83,8 @@ module Padrino
83
83
  # Constructs a text area input from the given options
84
84
  # text_area_tag :username, :class => 'long', :value => "Demo?"
85
85
  def text_area_tag(name, options={})
86
- options.reverse_merge!(:name => name, :value => '')
87
- content_tag(:textarea, options.delete(:value), options)
86
+ options.reverse_merge!(:name => name)
87
+ content_tag(:textarea, options.delete(:value).to_s, options)
88
88
  end
89
89
 
90
90
  # Constructs a password field input from the given options
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{padrino-helpers}
8
- s.version = "0.2.6"
8
+ s.version = "0.2.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
@@ -58,4 +58,8 @@ class Errors < Array
58
58
  def full_messages
59
59
  ["This is a fake error", "This is a second fake error", "This is a third fake error"]
60
60
  end
61
+ end
62
+
63
+ module Outer
64
+ class UserAccount; end
61
65
  end
@@ -33,6 +33,12 @@ class TestFormBuilder < Test::Unit::TestCase
33
33
  assert_has_tag('form input', :type => 'text', :name => 'markup_user[username]') { actual_html }
34
34
  assert_has_tag('form input[type=hidden]', :name => '_method', :count => 0) { actual_html } # no method action field
35
35
  end
36
+
37
+ should "display correct form html for namespaced object" do
38
+ actual_html = form_for(Outer::UserAccount.new, '/register', :method => 'post') { |f| f.text_field :username }
39
+ assert_has_tag('form', :action => '/register', :method => 'post') { actual_html }
40
+ assert_has_tag('form input', :type => 'text', :name => 'outer-user_account[username]') { actual_html }
41
+ end
36
42
 
37
43
  should "display correct form html with method :put" do
38
44
  actual_html = form_for(@user, '/update', :method => 'put') { "Demo" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team