everything is in the title… I’ve got a function declared in my
controller… I want to access it from a helper. I copied/pasted the
function in the controller and the helper and it works… But as Rails
is “DRY”, I’d like to find a better way…
It sounds like the method you want to call isn’t actually a public
method?
Otherwise calling it from a helper wouldn’t make sense. If it’s a
“helper”
method you want to call, then I’d suggest moving it into lib/.
everything is in the title… I’ve got a function declared in my
controller… I want to access it from a helper. I copied/pasted the
function in the controller and the helper and it works… But as Rails
is “DRY”, I’d like to find a better way…
What about if you put it into the model (presuming it does not have
controller or view specific code). Maybe you can elaborate a little
more on the purpose of your function