ruby - In Rails 2 yielding a block in a helper a method renders partial? -


rails 2.2.2

_competition.html.erb

<p>this packed</p> <% pack %> // javascript <% end %> 

competitions_helper.rb

def pack(&block)   yield + 'packed' end 

however 'packed' not appended javascript string, if pack do has no effect. seems there oddness going off context of blocks , actual view rendering because if remove call yield in helper , return hard coded string no output pack.

def pack(&block)   concat(capture(&block) + 'packed') end 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -