2

I have two helper files. events_helper.rb and users_helper.rb.

Both of these helper files have a method called foobar. In events controller, index view. If I call foobar. Shouldn't it load the helper foobar thats in events_helper.rb?

Or is this not the way helpers work?

Christian Fazzini
  • 19,613
  • 21
  • 110
  • 215

1 Answers1

0

Seems like all helpers are available - so not sure which it would choose in your case, ideally the events controller one... and from your comment, it seems like its chosen the wrong one.

Could you give them distinct names?

Why are all Rails helpers available to all views, all the time? Is there a way to disable this?

Community
  • 1
  • 1
Chris Kimpton
  • 5,546
  • 6
  • 45
  • 72
  • good link, thanks for it. that explains it all for rails 2 as well as rails 3 – rtdp Jun 24 '11 at 09:24
  • I'm not trying to disable it. I only want the foobar method from events_helper.rb to work in events#index. At the moment, its utilizing the foobar helper from the users_helper.rb file – Christian Fazzini Jun 24 '11 at 10:11