guoren/app/helpers/users_helper.rb

7 lines
137 B
Ruby
Raw Normal View History

2016-12-26 11:03:30 +08:00
module UsersHelper
def get_user_name_from_id user_id
user = User.where(id: user_id)
return user.name if !user.empty?
end
2016-12-26 11:03:30 +08:00
end