Allow empty fieldsets to be created without a block. #5234

Merged
merged 1 commit into from Mar 2, 2012

3 participants

@benpickles

Without this I have to use a superfluous empty block:

<%= field_set_tag 'Legend!' do %>
<% end %>
@drogus
Ruby on Rails member

Just curious, could you provide any good case when I would want to have an empty fieldset?

@benpickles

In our case we're populating the empty fieldset on the client-side - but it's also about minimising surprises: I was surprised to get a LocalJumpError when I didn't include a block.

@drogus
Ruby on Rails member

Makes sense, it's always a good practice to check for a block anyway.

@drogus drogus merged commit 9078dba into rails:master Mar 2, 2012
@homakov

<%= field_set_tag('Legend!'){} %>
looks lighter btw

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