Skip to content

Conversation

@archiloque
Copy link

No description provided.

@yb66
Copy link
Owner

yb66 commented Nov 7, 2015

Hi @archiloque

Thanks for this. It looks fine, but I either need a spec to go with it or an example I can use.

Regards,
iain

@archiloque
Copy link
Author

Hello,

an example, since I'm not sure how to make a relevant test

<form>
  <% yield %>
</form>
  • then declare a helper like this
def my_partial_with_block(&block)
  buffer << partial(:'my_helper.html', &block)
end
  • then in your erb file you can call the partial with a block
<% my_partial_with_block do %>
<!-- some html here -->
<% end %>

It's handy to make your templates cleaner when using things like bootstrap that require much boilerplate html.

@yb66
Copy link
Owner

yb66 commented Nov 7, 2015

Ok, thanks. I'll give it a look over the weekend and try to knock up some relevant specs for it.

regards,
iain

@archiloque
Copy link
Author

After thinking about it I wonder if it would make sense to include the gist content in the gem since using partial with blocks like in rails is a not-so-rare usecase, what do you think ?

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.

2 participants