Julia
Julia

Reputation: 171

Ruby on Rails: Calling helper functions in controller methods

Can we call helper functions in controller methods? Can you give me a simple example too?

Upvotes: 0

Views: 41

Answers (1)

PinnyM
PinnyM

Reputation: 35531

Sure, just include the helper in the controller:

def MyController < ApplicationController
  include MyHelper
  ...
end

Upvotes: 2

Related Questions