i have this code in rails
<%= button_to "Destroy this post", @post, method: :delete %>
and it is returning <button .... /button>
but I want to return <bx-btn .... /bx-btn>
instead. How can I achieve that and where exactly I can modify the code? Thank you!
I tried to search but nothing results in sufficient explanatory to mi issue or I could not comprehend the answer. I tried rails guides but I cant seem to find the documentation or I cant decribe what I am searching for.
If what you want is to monkey-patch
button_to
, probably isn't a good idea.A better choice might be to create a helper that works as a
content_tag
extension, like:then use it as:
or as a block: