Ruby on rails DeVICE有时会在生产中的编辑\用户\注册\路径上注销用户
所以我绞尽脑汁想弄明白:当用户导航到Ruby on rails DeVICE有时会在生产中的编辑\用户\注册\路径上注销用户,ruby-on-rails,heroku,devise,Ruby On Rails,Heroku,Devise,所以我绞尽脑汁想弄明白:当用户导航到edit\u user\u registration\u路径时,他们有时会注销。这只发生在生产中(我们目前在heroku上运行2个dyno,我尝试缩小到1个,但没有帮助)。我们将子域用于多租户,并在生产中使用SSL。在开发过程中,这从未发生过,规范检查也在通过 我们在轨道4.1.4,设计3.2.4和典狱长1.2.3 我们的应用程序是开源的,回购已经结束,但我们已经定制了一些小片段: config/routes.rb devise_for :users, :co
edit\u user\u registration\u路径时,他们有时会注销。这只发生在生产中(我们目前在heroku上运行2个dyno,我尝试缩小到1个,但没有帮助)。我们将子域用于多租户,并在生产中使用SSL。在开发过程中,这从未发生过,规范检查也在通过
我们在轨道4.1.4
,设计3.2.4
和典狱长1.2.3
我们的应用程序是开源的,回购已经结束,但我们已经定制了一些小片段:
config/routes.rb
devise_for :users, :controllers => { registrations: "users/registrations" }
app/controllers/users/registrations.html.erb
class Users::RegistrationsController < Devise::RegistrationsController
def destroy
redirect_to root_url
end
protected
def build_resource(hash=nil)
user = super(hash)
user.organization = current_account
end
end
类用户::注册控制器<设计::注册控制器
def销毁
将\u重定向到根\u url
终止
受保护的
def build_资源(散列=nil)
user=super(散列)
user.organization=当前账户
终止
终止
app/views/design/registrations/edit.html.erb
<div class="outer">
<div class="container">
<h2> <%= t('registration.edit', resource_name: resource.class.model_name.human) %> </h2>
<%= gravatar_image_tag(resource.email, gravatar: { secure: true }, class: "image-circle", title: resource.full_name) %>
<p><%= t("registration.gravatar_instructions_html") %></p>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs edit-user">
<%= f.input :email, required: true, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p><%= t('registration.pending_information', unconfirmed_email: resource.unconfirmed_email) %></p>
<% end %>
<%= f.input :password, autocomplete: "off", hint: t('registration.hint.blank'),required: false %>
<%= f.input :password_confirmation, required: false %>
<%= f.input :current_password, hint: t('registration.hint.current_password'), required: true %>
</div>
<div class="form-actions">
<%= f.button :submit, t('registration.update_button') %>
</div>
<% end %>
<%= link_to t('back'), :back %>
</div>
</div>
我尝试搜索有类似问题的人,但我找不到任何人在打开编辑用户注册路径时有问题
我们回购的问题如下:
希望任何人都能给我指出正确的方向,谢谢 日志是怎么说的,它有时显示重定向暂停。。检查一下。它可能会有帮助。当它失败时,它甚至似乎没有到达终点,所以它可能是监狱长的某件事?