jeudi 29 mai 2014

application helper method invoking in another helper


Vote count:

0




I am stuck in a weird Design problem,


I'm facing issues when I'm trying to invoke a application helper method in another helper which have multiple class and want to access application helper method.


what is the better approach?


Thoughts about what can I do?


my code looks similar like this,




module ApplicationHelper
def my_name
"stackoverflow"
end
end


Another helper with sub classes




module MyHelper
class MyTestclass
def want_myname
my_name ## giving undefined method-- how can i call myname method here?
end
end
end

undefined method `myname' for MyHelper::MyTestclass



asked 39 secs ago






Aucun commentaire:

Enregistrer un commentaire