Hi, guys!
I've been struggling with this a while and I decided to ask for help.
In rails, I created a helper method for rendering a custom partial, like this:
def component(component_name, locals = {}, &block)
name = component_name.split("_").first
render("components/#{name}/#{component_name}", locals, &block)
end
So, in the view, I can do something like this:
_box.html.erb
<div class='box'>
<%= yield %>
</div>
_message.html.erb
<div class='message'>
<%= yield %>
</div>
<% component("box") do %>
<% component("message") do %>
<p>Hello World!</p>
<% end %>
<% end %>
And it outputs
<div class='box'>
<div class='message'>
<p>Hello World!</p>
</div>
</div>
I really need to create it in Padrino but I can't do it.
Could anyone help me?
Thanks,
Paulo