I originally started this for myself as a neat way to post my problems and hopefully solutions as I go though the wilderness of teaching myself ruby on rails. Since starting this little endeavor I have been working closely with an iphone developer and an android developer as they work though the difficulties of developing in their respective platforms. I mentioned what I was doing and they liked it so much they wanted to contribute as well so I am widening the scope of this blog to include iphone and android development as well as ruby on rails. So even more posts to come. Shweet...

What I'm trying to do is call a helper method from a partial. I have two different views in two different controllers both calling a partial. This partial calls a helper called my_helper so for the view in controller foo the partial should call the my_helper method in the foo_helper and the view in controller bar should call the my_helper method in the bar_helper and all would be right with the world.

If I have a helper method I want accessible to both controllers I would put it in my application_helper.

Well as it stands that is not the case. (at least not out of the box)
While ruby on rails has this great organization for their helpers out of the box it appears they decided to throw a monkey wrench in that intuitive goodness by adding a line by default in the application controller (helper :all) which makes it so you can access a method in any helper from any controller view. Isn't that what the application_helper is specifically for? I can't for the life of me think of a reason why rails would do this by default. I would guess this has caused more than a few n00bs who aren't entirely familiar with helpers to bang their heads against the wall and scream why isn't this working!!!!

Don't get me wrong I like how flexible rails made the helpers by allowing me to make my own and mix and match helpers however I want. I just don't know why they would make every helper available to every controller by default. Well this turned out to be the push I needed to learn about how helpers work so I guess I can't be too annoyed.

I'm sorry if this turned into a rant and I really hope this helps save some poor n00b some time. If you are uber l33t and you happen to know the logic behind why rails adds helper :all to the application_helper by default post a comment. I am dying to know.