0

I'm writing a helper in my Calls view that changes the text of a span depending on a evaluation of a date. When I write the if/else in the view I can make it work but I get the error "uninitialized constant CallsHelper::Active" when trying to access it from my helper.

view code:
 <%= status_indicator(call)%>

helper code:
 def status_indicator(call)
    if call.transfer_date > Time.zone.now
      Scheduled
    else
      Active
    end
  end

I'm not sure what the error is trying to tell me besides it's not working. Can someone give me a hand and let me know where I'm going wrong?

nulltek
  • 3,247
  • 9
  • 44
  • 94

1 Answers1

0

I want to return strings and not Ruby classes. Putting "" around the strings fixed the problem.

nulltek
  • 3,247
  • 9
  • 44
  • 94