i trying make app in rails 4. i trying follow along tutorial: http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/ i have moved after_sign_in_path omniauth callbacks controller application controller, can extend it. my current attempt in application controller is: def after_sign_in_path_for(resource) if !resource.email_verified? finish_signup_path(resource) elsif params[:redirect_to].present? store_location_for(resource, params[:redirect_to]) elsif request.referer == new_session_url profile_path(resource.profile) # or whatever route destination want else store_location_for(resource) || request.referer || root_path end end when try this, error: argumenterror in users::omniauthcallbackscontroller#linkedin wrong number of arguments (0 1+) it highlights line of above method: elsif request.referer == new_session_url i don't know error message means....
i have made program stores score attached name in .txt file. however, want print alphabetical order of name attached score. when run program come error io.unsupportedoperation: not writable here code: file = open(class_name , 'r') #opens file in 'append' mode don't delete information name = (name) file.write(str(name + " : " )) #writes information file file.write(str(score)) file.write('\n') linelist = file.readlines() line in sorted(linelist): print(line.rstrip()); file.close() you have opened file read only, attempted write it. file left open, attempt read it, if in append mode, file pointer @ end of file. try instead: class_name = "class.txt" name = "joe" score = 1.5 file = open(class_name , 'a') #opens file in 'append' mode don't delete information name = (n...
Comments
Post a Comment