Skip to content

Instantly share code, notes, and snippets.

@katienreed
Created November 9, 2016 02:16
Show Gist options
  • Save katienreed/c8eeb451c4e4b614c3b8b9bed28bfeb8 to your computer and use it in GitHub Desktop.
Save katienreed/c8eeb451c4e4b614c3b8b9bed28bfeb8 to your computer and use it in GitHub Desktop.
#app/controllers/my_controller.rb
module UnitCheck
def unit_check(number, time)
if number = 1
number + time.chop!
else
number + time
end
end
end
class MyController < ApplicationController
include UnitCheck
def concat_string
unit_check(number, time)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment