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

drupal - using views argument in the view tpl.php file -

php - Posting PHPBB Forum Thread/Post info in a website -

php - Add a blog by sending a mail to a certain emailadress -