Hi pry_f ! Sorry but I'm not sure to have exactly understood what you're trying to do. What I understand from the code you made available is that the lines below should display something like
<p>opening</p> <li> elem1: parent is my-parent</li> <li> elem2: parent is my-parent</li> <p>closing</p> and it doesn't ? Le jeudi 6 juin 2013 19:48:46 UTC+2, Ruby-Forum.com User a écrit : > > Hi I'm having a problem creating a view widget inside my erb template. > > Please see the following gist https://gist.github.com/5723324 > > Basically I'm trying to isolate a complex piece of html markup with > something like : > > <%= Accordion.new(parent: "my-parent") do |accordion| %> > accordion.element("elem1") > accordion.element("elem2") > <% end %> > > But yielding self does not return my object instance but the erb > template. It seems in rails there is a need to "capture" a given block > but I can't figure out how to do this. I'm able to do something similar > via a rails helper however I wanted to create an object to keep things > DRY. Any help much appreciated ! > > -- > Posted via http://www.ruby-forum.com/. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e8a868f8-1ca9-4366-bb0a-31137f4f0e98%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.

