使用devise在Rails 4.2中忘记密码错误

时间:2016-07-08 16:13:29

标签: ruby-on-rails devise

我将我的设计版本从1.4.9迁移到4.2.0。在sessions / new表单中,我还在模态中使用密码/ new。我在运行会话新表单时遇到错误。请帮忙:

这是错误堆栈:

  

ArgumentError - 参数数量错误(给定3,预期0..1):
  bartt-ssl_requirement(1.4.2)lib / url_for.rb:9:in   url_for_with_secure_option' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:280:in呼叫' ActionPack的   (4.2.6)lib / action_dispatch / routing / route_set.rb:223:在call'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:345:in
块(2级)in define_url_helper' actionpack(4.2.6)   lib / action_dispatch / routing / routes_proxy.rb:32:in user_password_path' devise (4.2.0) lib/devise/controllers/url_helpers.rb:51:in块(4   等级)在generate_helpers!'应用程序/视图/会话/ new.html.erb:45:在   _app_views_sessions_new_html_erb__3241459270597214406_43798180'
actionview (4.2.6) lib/action_view/template.rb:145:in
阻止   渲染' activesupport(4.2.6)   lib / active_support / notifications.rb:166:in instrument' actionview (4.2.6) lib/action_view/template.rb:333:in instrument'的ActionView   (4.2.6)lib / action_view / template.rb:143:在render' actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:54:in块中(2   在render_template'中actionview(4.2.6)   lib / action_view / renderer / abstract_renderer.rb:39:在仪器的block in instrument' activesupport (4.2.6) lib/active_support/notifications.rb:164:in块中'
  activesupport(4.2.6)   lib / active_support / notifications / instrumenter.rb:20:在instrument'
activesupport (4.2.6) lib/active_support/notifications.rb:164:in
工具' actionview(4.2.6)   lib / action_view / renderer / abstract_renderer.rb:39:在render_template中的instrument'
actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:53:in
块中' actionview(4.2.6)   LIB / ACTION_VIEW /渲染器/ template_renderer.rb:61:在   render_with_layout' actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:52:in render_template'   actionview(4.2.6)lib / action_view / renderer / template_renderer.rb:14:in   render' actionview (4.2.6) lib/action_view/renderer/renderer.rb:46:in render_template'
  actionview(4.2.6)lib / action_view / renderer / renderer.rb:27:in render' actionview (4.2.6) lib/action_view/rendering.rb:100:in _ render_template' actionpack(4.2.6)   lib / action_controller / metal / streaming.rb:217:在_render_template'
actionview (4.2.6) lib/action_view/rendering.rb:83:in
render_to_body'   actionpack(4.2.6)lib / action_controller / metal / rendering.rb:32:in   render_to_body' actionpack (4.2.6) lib/action_controller/metal/renderers.rb:37:in render_to_body'
  actionpack(4.2.6)lib / abstract_controller / rendering.rb:25:in render' actionpack (4.2.6) lib/action_controller/metal/rendering.rb:16:in render' actionpack(4.2.6)   lib / action_controller / metal / instrumentation.rb:44:在block (2 levels) in render' activesupport (4.2.6) lib/active_support/core_ext/benchmark.rb:12:in块中的ms'
  /home/osiuser/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:308:in   realtime' activesupport (4.2.6) lib/active_support/core_ext/benchmark.rb:12:in MS' ActionPack的   (4.2.6)lib / action_controller / metal / instrumentation.rb:44:在block in render' actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:87:in cleanup_view_runtime' activerecord(4.2.6)   LIB / active_record / railties / controller_runtime.rb:25:在   cleanup_view_runtime' actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:43:in渲染'
  remotipart(1.2.1)lib / remotipart / render_overrides.rb:14:in   render_with_remotipart' responders (2.2.0) lib/action_controller/responder.rb:238:in default_render'
  responders(2.2.0)lib / action_controller / responder.rb:170:在to_html' responders (2.2.0) lib/action_controller/responder.rb:163:in回复'   responders(2.2.0)lib / action_controller / responder.rb:156:在call'
responders (2.2.0) lib/action_controller/respond_with.rb:205:in
respond_with'设计(4.2.0)   app / controllers / devise / sessions_controller.rb:12:在'new'

这些是我面临的错误:

sessions / new(第45行):

<%= semantic_form_for(resource, :as => resource_name, :url => password_path(resource_name), :remote => true, :format => :json, :html => { :id => 'password_reset' }) do |f| %>
  <%= f.inputs do %>
     <%= f.input :email, :label => 'Your email address', :input_html => { :placeholder => "Enter your email..."}%>
  <% end %>
  <%= f.buttons do %>
     <%= f.commit_button :label => 'Send me that link', :button_html => {:class => 'submit button'}%>
  <% end %>
<% end %>

设计/ session_controller:

  def new
    self.resource = resource_class.new(sign_in_params)
    clean_up_passwords(resource)
    yield resource if block_given?
    respond_with(resource, serialize_options(resource)) #this is the line it's showing error.
  end

在我的会话控制器中,没有新方法,只有创建和重定向方法,我没有密码控制器。

这是我的路线:

  devise_for :users, :controllers => {:sessions => 'sessions'}, :path => '', :path_names => { :sign_in => "login", :sign_out => "logout" }

它在旧版本中工作,所以我没有改变路线。 请帮忙

0 个答案:

没有答案