• S
    accept a block in button_to helper · ab7a80ea
    Sergey Nartimov 提交于
    Make possible to use a block in button_to helper if button text is hard
    to fit into the name parameter, e.g.:
    
        <%= button_to [:make_happy, @user] do %>
          Make happy <strong><%= @user.name %></strong>
        <% end %>
        # => "<form method="post" action="/users/1/make_happy" class="button_to">
        #      <div>
        #        <button type="submit">
        #          Make happy <strong>Name</strong>
        #        </button>
        #      </div>
        #    </form>"
    ab7a80ea
url_helper_test.rb 27.2 KB