Call Rails helper method from another helper method

paweldabrowski

Paweł Dąbrowski

Posted on January 2, 2020

Call Rails helper method from another helper method

Since 4 version of Rails, helpers are loaded in the view so it is possible to call one helper method from another one without including helpers:

module ApplicationHelper
  def some_method_from_application_helper
    # do something
  end
end

module AnotherHelper
  def do_something
    some_method_from_application_helper # will work
  end
end

Thank you for reading! Follow me on Twitter to be up to date with the latest tips, articles, and videos about programming.

💖 💪 🙅 🚩
paweldabrowski
Paweł Dąbrowski

Posted on January 2, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related