@account = if params[:account][:id].blank?
                       if request.referer =~ /\/accounts\/(\d+)\z/
                         Account.find(Regexp.last_match[1]) # related account
                       else
                         Account.new(user: current_user)