There is something I have been trying to implement but so far no luck.
Basically, I want to have helpers that generate HTML around given
content, similar to ActionView’s form_for. Besides, I want to keep
that “framing” HTML in separate files, similar to templates.
Ideally I’d even love to suggest it as a feature for Rails. Let me
show you an example.
This is what I want to have in my rhtml file:
<% bubble_block :corners => “round”, :color => “brown” do %>
My content
<% end %>
So far I have tried the following: I added a method to my application
helper:
I already know how to do it without external .rhtml (I can use
concat() inside of bubble_for). However, the entire idea is about
using external .rhtml files for surrounding HTML, since there is a lot
of HTML and having that HTML embedded into ruby code is not practical
(designers need to touch it).
What exactly in my implementation causes the wrapped block to render
twice? Inside and outside of the surrounding HTML?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.