Skip to content

Commit f7e437d

Browse files
committed
Merge pull request activeadmin#313 from rolfb/master
Fix for issue activeadmin#197
2 parents 5b002fa + ec52dd4 commit f7e437d

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

features/edit_page.feature

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,35 @@ Feature: Edit Page
5252
And I should see the attribute "Title" with "Hello World from update"
5353
And I should see the attribute "Author" with "John Doe"
5454

55+
Scenario: Generating a custom form with :html set, visiting the new page first (bug probing issue #109)
56+
Given a configuration of:
57+
"""
58+
ActiveAdmin.register Post do
59+
form :html => {} do |f|
60+
f.inputs "Your Post" do
61+
f.input :title
62+
f.input :body
63+
end
64+
f.inputs "Publishing" do
65+
f.input :published_at
66+
end
67+
f.buttons
68+
end
69+
end
70+
"""
71+
Given I follow "New"
72+
Then I follow "Posts"
73+
Then I follow "Edit"
74+
Then I should see a fieldset titled "Your Post"
75+
And I should see a fieldset titled "Publishing"
76+
And the "Title" field should contain "Hello World"
77+
And the "Body" field should contain ""
78+
When I fill in "Title" with "Hello World from update"
79+
When I press "Update Post"
80+
Then I should see "Post was successfully updated."
81+
And I should see the attribute "Title" with "Hello World from update"
82+
And I should see the attribute "Author" with "John Doe"
83+
5584
Scenario: Generating a form from a partial
5685
Given "app/views/admin/posts/_form.html.erb" contains:
5786
"""

lib/active_admin/view_helpers/form_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module ViewHelpers
33
module FormHelper
44

55
def active_admin_form_for(resource, options = {}, &block)
6+
options = Marshal.load( Marshal.dump(options) )
67
options[:builder] ||= ActiveAdmin::FormBuilder
78
semantic_form_for resource, options, &block
89
end

0 commit comments

Comments
 (0)