I used
rails generate devise:views:bootstrap_templates
to generate bootstrap templates for my app, and though the app is working,
<%= bootstrap_devise_error_messages! %>
in app/views/devise/registrations/new.html.erb is not showing on the app UI when I attempt to sign up (through the generated devise sign up page), i.e. no error message appears if I submit a blank form telling me I cannot have an empty password or some such. However, I do get an error message telling me I need to sign-in to proceed on the users sign-in page. Advice appreciated.
Related
I'm using rails to send an email to log in a user through a link. In that email I have a button and link that both use the same url but with the button I'm getting a 404 error while using google or yahoo's main site to view the email. While using third party email portals I don't seem to have this issue. The link works in all circumstances.
In the view for the email template, I'm using the button_to tag for the button that will redirect the user to the site to log them in. Which I noticed puts the button into a form. So I was wondering if this was a safety measure by google and yahoo to prevent potential threats and I need to refactor to just have a button without the form element, or could it be an issue with my code?
I have a view that displays list of users for a event and I have provided CRUD actions views for users view.
When superadmin tries to edit details of user, everything works fine.
but when user tries to use back button to return to its existing state, a Confirm Form Submission message displays.
And there's no error in rails console.
is there a way to solve this issue?
Confirm Form Submission Error
I have a Rails 4.2 application. Several months ago we started experiencing Invalid Authenticity Token errors. I've discovered that the following scenario reproduces the error:
1) User opens up browser and visit's ourwebsite.com/log-in.
2) User opens up second tab in the same browser and visits ourwebsite.com/enroll-in-course.
3) User goes back to tab one and logs in submitting a POST form.
4) User goes to tab two and submits a POST form on the enroll-in-course page.
5) Error appears.
Here's some general information about our app:
We are using Devise 3.4.1 with zero customization applied.
Our application controller runs protect_from_forgery with: :exception.
We use Turbolinks 2.5.
We are not caching either forms.
We run Turbolinks.pagesCached(0); in our Javascript on all pages.
To reiterate, both forms in the above scenario are POST forms. They work perfectly fine except in the above scenario.
From my knowledge, we have not made any changes in handling user sessions or CSRF tokens.
I have a theory that because we log in the user, the csrf_token stored in the session changes. Thus when the user submits a form in the second tab, the token from form will not match the token in the session and an InvalidAuthenticityToken is raised. What's wrong and how do I fix this? Better yet, is this even fixable?
After we update our RoR application and user has opened form and submits his form after code is updated our RoR application says Invalid Authenticity Token and than logs out user who submitted the form.
Is there any way how to solve this and update our code without logging out our users when they have submitted form after code is updated?
I've got a rails 3.2 app using active admin 0.4.3. It uses an employee model as the admin users. I've added a link to the Active Admin dashboard so the currently signed in employee can change their password if they want.
section :admin_tasks do
div do
link_to "Change Password", new_employee_password_path
end
end
However when I click the link I get a flash message saying that I'm already signed in. How would I go about adding a change password dialog to the active admin section of my app?
I used new_employee_password_path because it's what came up in the routes and it seemed appropriate. I also tried edit_employee_password_path but that didn't work either.
This page in the ActiveAdmin wiki should help https://github.com/gregbell/active_admin/wiki/How-to-add-User-Accounts-for-users-to-administer-their-personal-accounts