module AHelper
class Builder
def link
build_link(@apple)
end
end
def build_link(sth)
link_to "#", "buy #{sth}"
end
end
In a helper module, link_to method is available to be invoked but inside the class Builder, it isn't. So I'm looking a way to call external method included in a helper module and passing a instance variable value to this method.
I don't want to include ActionView::UrlHelper into the class as it is already available to the helper module. And link_to is just an example case to demo the needs here. How to do this in ruby on rails?