padrino-helpers 0.2.6 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
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
|
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
|
data/padrino-helpers.gemspec
CHANGED
@@ -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.
|
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"]
|
data/test/test_form_builder.rb
CHANGED
@@ -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" }
|