Hi Guys,
I got a helper method that I want to use more than once. The only thing
that will change will be the variable that is used to collect the data.
For example;
def render_blocks
position = 0
@variable.collect { |question, answer|
position += 1
“
#{position}. <a
name=”#{block_to_anchor(question)}">#{question}
" +content_tag(‘div’, simple_format(answer))
}
end
I need to call this helper method from different pages. Can I pass
something through to the helper method that changes the variable name to
the one I want…
For example
<%= render_blocks :page => ‘free’ %> on one page that changed @variable
to @free and
<%= render_blocks :page => ‘faq’ %> that changes @variable to @faq.
Any help would be greatly appreciated.