Add support for passing html options to #inputs #18

Merged
merged 1 commit into from Nov 5, 2011

Conversation

Projects
None yet
2 participants
@pivotale20

We wanted to add class names to our fieldsets, so we added a way to do it a la SimpleForm by passing in :fieldset_html

There are a lot of other places it could make sense to do the same thing.

@stouset

This comment has been minimized.

Show comment Hide comment
@stouset

stouset Nov 4, 2011

Owner

I think in this case, given that the fieldset is the whole point of the method, it'd be fine to make the options implicitly HTML options on the fieldset itself (i.e, no :fieldset_html wrapper). Do you mind making this change and resubmitting the pull request?

Owner

stouset commented Nov 4, 2011

I think in this case, given that the fieldset is the whole point of the method, it'd be fine to make the options implicitly HTML options on the fieldset itself (i.e, no :fieldset_html wrapper). Do you mind making this change and resubmitting the pull request?

@pivotale20

This comment has been minimized.

Show comment Hide comment
@pivotale20

pivotale20 Nov 4, 2011

The reason we did it as :fieldset_html was that if in the future someone wants to do :legend_html it would be a nice way to split them out.

That said, you are right, the whole point is to create a fieldset wrapping the block, so I think :html makes sense. It matches how form_tag works.

The reason we did it as :fieldset_html was that if in the future someone wants to do :legend_html it would be a nice way to split them out.

That said, you are right, the whole point is to create a fieldset wrapping the block, so I think :html makes sense. It matches how form_tag works.

@pivotale20

This comment has been minimized.

Show comment Hide comment
@pivotale20

pivotale20 Nov 4, 2011

Done!

Done!

@stouset

This comment has been minimized.

Show comment Hide comment
@stouset

stouset Nov 4, 2011

Owner

If we need to do overrides later for the <legend> (unlikely, but maybe), then we'll do a :legend_html for that.

Owner

stouset commented Nov 4, 2011

If we need to do overrides later for the <legend> (unlikely, but maybe), then we'll do a :legend_html for that.

@stouset

This comment has been minimized.

Show comment Hide comment
@stouset

stouset Nov 4, 2011

Owner

Sorry, I might not have been clear in my description of how I wanted it done. Can you remove the :html scoping entirely? You should be able to just call it like:

    f.inputs('Sign up', :class => 'sign_up')
Owner

stouset commented Nov 4, 2011

Sorry, I might not have been clear in my description of how I wanted it done. Can you remove the :html scoping entirely? You should be able to just call it like:

    f.inputs('Sign up', :class => 'sign_up')

@stouset stouset merged commit b455222 into stouset:master Nov 5, 2011

@stouset

This comment has been minimized.

Show comment Hide comment
@stouset

stouset Nov 5, 2011

Owner

I merged this in, but tweaked it to remove the extra hash layer.

Owner

stouset commented Nov 5, 2011

I merged this in, but tweaked it to remove the extra hash layer.

@stouset

This comment has been minimized.

Show comment Hide comment
@stouset

stouset Nov 11, 2011

Owner

1.0.3 has been released with this fix included.

Owner

stouset commented Nov 11, 2011

1.0.3 has been released with this fix included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment