module MainHelper

Protected Instance Methods

current_user=(user) click to toggle source

Sets current user for this session

# File app/helpers/main_helper.rb, line 6
def current_user=(user)
  session[:uid] = (user.blank? || !user.kind_of?(User)) ? nil : user.id
end
due_date_color(assignment) click to toggle source
# File app/helpers/main_helper.rb, line 23
def due_date_color(assignment)
  assignment.past_collection_date? ? 'after' : 'before'
end
get_blank_message(blank_login, blank_password) click to toggle source
# File app/helpers/main_helper.rb, line 10
def get_blank_message(blank_login, blank_password)
  return '' unless blank_login || blank_password

  if blank_login && blank_password
    I18n.t(:username_and_password_not_blank)
  elsif blank_login
    I18n.t(:username_not_blank)
  elsif blank_password
    I18n.t(:password_not_blank)
  end

end