hello all, I was hoping someone could describe to me how this works.
Say I have some block of code like this
<% my_cool_block do %>
<% my_var = 5 %>
<%= some_helper_method "My var" %>
<% end %>
And in my helper
def my_cool_block(&block)
content = capture(&block)
concat(content, block.binding)
end
def some_helper_method(text)
"#{text} = #{my_var}
end
How can i get some_helper_method to 'know' about my_var which is in the
scope of the my_cool_block block? And even better yet, how could I get
the some_helper_method only to work when it is nested inside a
my_cool_block block?
Let me know if I can clarify anything for you.
Thanks!
--
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---