Protecting edit page from incorrect users and redirect after sign_in