8000 Form builder patch by qoobaa · Pull Request #1760 · activeadmin/activeadmin · GitHub
[go: up one dir, main page]

Skip to content

Form builder patch #1760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Form builder patch #1760

wants to merge 2 commits into from

Conversation

qoobaa
Copy link
@qoobaa qoobaa commented Nov 7, 2012

No description provided.

@jpmckinney
Copy link
Contributor

Just waiting for Travis.

@qoobaa
Copy link
Author
qoobaa commented Nov 7, 2012

Scumbag Travis. I'm pretty sure my test passes, it shouldn't break anything as well. I'll check it again.

@qoobaa
Copy link
Author
qoobaa commented Nov 7, 2012

Ugh. It breaks a few tests :-(. I'll fix it soon.

@qoobaa
Copy link
Author
qoobaa commented Nov 7, 2012

Grr. That's madness - jiggling form_buffers around the class... My mind is going to explode soon. Why is it so complex señor?

@qoobaa qoobaa closed this Nov 15, 2012
super
# Ensure the buffer is returned instead of the block result itself
form_buffers.last
end
form_buffers.last << content.html_safe
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rewrite it like this:

def inputs(*args, &block)
  @inputs_with_block = !!block_given? # Record whether a block is passed
  form_buffers.last << with_new_form_buffer{ super; form_buffers.last }.html_safe
end

@seanlinsley
Copy link
Contributor

@qoobaa why did you close this pull request?

@qoobaa
Copy link
Author
qoobaa commented Mar 11, 2013

I wasn't able to fix the tests :-(.

@seanlinsley
Copy link
Contributor

I crafted a working solution: #1996 :]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0