devise

Could not find devise mapping for path “/sessions/user” devise log in error

北慕城南 提交于 2020-01-12 12:50:52
问题 Very frustrating for the last few days. I have a rails app with Devise installed where I generated a new User model and I generated Devise views as well. This happens when I try to sign in as an existing user right when I click "Log in" after filling out the email and password fields: AbstractController::ActionNotFound - Could not find devise mapping for path "/sessions/user". This may happen for two reasons: 1) You forgot to wrap your route inside the scope block. For example: devise_scope

Rails Devise Bootstrap Sign Up modal

99封情书 提交于 2020-01-12 10:36:51
问题 I'm trying to alter my devise registration view file to work with bootstrap modals. I have followed the bootstrap instructions and slotted the form into the modal and linked it to the navbar menu. Now, when i click on 'Register' in my navbar. Nothing happens. The form doesn't go anywhere. I had this working when it was just a standard page view. Can anyone help? Thank you. I am trying to follow this answer but am getting confused: Twitter Bootstrap Modal not popping up for user login I have:

Rails Devise Bootstrap Sign Up modal

血红的双手。 提交于 2020-01-12 10:36:47
问题 I'm trying to alter my devise registration view file to work with bootstrap modals. I have followed the bootstrap instructions and slotted the form into the modal and linked it to the navbar menu. Now, when i click on 'Register' in my navbar. Nothing happens. The form doesn't go anywhere. I had this working when it was just a standard page view. Can anyone help? Thank you. I am trying to follow this answer but am getting confused: Twitter Bootstrap Modal not popping up for user login I have:

How do I get my new registrations Devise form to be AJAXified?

删除回忆录丶 提交于 2020-01-12 09:54:15
问题 What I want to happen is when the account is successfully created, the form that was submitted should disappear and a message should appear (depending on the status of the registration). If it was successful, they should see a simple "Thank you. Please check your email." If it wasn't, then they should see an appropriate message - like "Sorry, that email has already been taken." This is my form: <div class="nine columns offset-by-three sign-up-form"> <%= form_for(resource, :as => resource_name

Retrieve rails/devise current_user from Backbone

孤街醉人 提交于 2020-01-12 02:05:37
问题 I have an app where I manage the sign up/in/out with Rails through Devise. When I'm logged in, i'm redirected to Dashboard#index where Backbone start. I would like to retrieve somehow my current_user.id and current_user.token in Backbone. My only idea is to have this in my dashboard.html.haml :javascript window.App.current_user.id = "#{current_user.id}" window.App.current_user.token = "#{current_user.token}" 回答1: (Just beware that only public information should be accesible in the client side

Retrieve rails/devise current_user from Backbone

独自空忆成欢 提交于 2020-01-12 02:05:33
问题 I have an app where I manage the sign up/in/out with Rails through Devise. When I'm logged in, i'm redirected to Dashboard#index where Backbone start. I would like to retrieve somehow my current_user.id and current_user.token in Backbone. My only idea is to have this in my dashboard.html.haml :javascript window.App.current_user.id = "#{current_user.id}" window.App.current_user.token = "#{current_user.token}" 回答1: (Just beware that only public information should be accesible in the client side

Retrieve rails/devise current_user from Backbone

你离开我真会死。 提交于 2020-01-12 02:05:09
问题 I have an app where I manage the sign up/in/out with Rails through Devise. When I'm logged in, i'm redirected to Dashboard#index where Backbone start. I would like to retrieve somehow my current_user.id and current_user.token in Backbone. My only idea is to have this in my dashboard.html.haml :javascript window.App.current_user.id = "#{current_user.id}" window.App.current_user.token = "#{current_user.token}" 回答1: (Just beware that only public information should be accesible in the client side

Select enum from form to set role

心不动则不痛 提交于 2020-01-11 17:56:24
问题 Ruby on Rails 4.1 I am using Devise with enum role. It currently sets a defualt role when the User is created. I want to add a field to the form that creates Users to set the enum role. I read this but it doesn't say how to utilize the new roles. This is the User class devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, :trackable, :validatable enum role: [:user, :vip, :admin, :developer, :marketing, :support, :translator] after_initialize :set_default

How to remove devise password resetting during email confirmation?

会有一股神秘感。 提交于 2020-01-11 14:09:26
问题 My email confirmation works with devise, however I want to remove this automatic password resetting. I don't manage to find in which file devise orders this action. Thank you in advance ! 回答1: Just disable :recoverable module in User model and remove Forgot your password? link in devise/sessions/new.html.erb 回答2: If you don't want password recovery functionality in Devise, you should not set devise attribute ':recoverable' in your model. Please remove this attribute from your model, remove

Admin Change Approval Status of User - Rails + Devise + Cancancan

守給你的承諾、 提交于 2020-01-11 12:54:14
问题 I followed this link to figure out how to have an admin approve a new user. I have an approved attribute on my User model that is a boolean. 2 problems - 1) when I'm logged in as admin and go to the edit user via the link_to "Edit", edit_user_path(user) to change approved user - the url is for the correct user but then the update action tries to update the current admin user. 2) I would prefer to have the override of the needed current password so I've put a method in the Registrations