I have a method in application_helper:
def methodname(argument)
if "XXXX".match(/#{argument}/i).present?
puts "YYYY"
else
end
And in console:
require "#{Rails.root}/app/helpers/application_helper"
=> true
include ApplicationHelper
=> Object
> methodname("argument")
YYYY=> nil
> loremipsum = methodname("argument")
YYYY=> nil
> loremipsum
=> nil
So it returns YYYY which is correct but it also returns nil for some reason beyond my understanding. I only need YYYY. How can I "extract" / use it? I would like:
> somemagicalcommand
> "YYYY"
:)
TIA!