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
Post a Comment