2 helpers, same method name?

I have 2 controllers, say, “A”, and “B”. Associated with this, then,
are 2 views, as well as 2 helpers.

Is it possible to have a helper method in a_helper.rb and a method of
the same name in b_helper.rb?

A little more specifically, I have a helper method to display a chart;
the helper method really just turns around and invokes a method on the
controller and does a send_data to send the image. The implementation
of the helper methods is a little bit different (given different
controllers and images), but the intent was the same, so I named the
helper method the same in both helpers. I would have thought that,
while the “A” view was being rendered, only the “A” helper was
available, but the error message I’m getting indicates that the helper
from “B” is being invoked (I can easily tell because the B helper
takes a parameter while the A helper does not).

Is it not possible to use the same helper method name in two different
helpers?

Thanks!

j

On May 8, 9:00 pm, dr_j [email protected] wrote:

I have 2 controllers, say, “A”, and “B”. Associated with this, then,
are 2 views, as well as 2 helpers.

Is it possible to have a helper method in a_helper.rb and a method of
the same name in b_helper.rb?

Remove helper :all from application.rb

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs