我将我的设计版本从1.4.9迁移到4.2.0。在sessions / new表单中,我还在模态中使用密码/ new。我在运行会话新表单时遇到错误。请帮忙:
这是错误堆栈:
ArgumentError - 参数数量错误(给定3,预期0..1):
中
bartt-ssl_requirement(1.4.2)lib / url_for.rb:9:inurl_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'
块(2级)in define_url_helper' actionpack(4.2.6) lib / action_dispatch / routing / routes_proxy.rb:32:in
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:345:inuser_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'
阻止 渲染' activesupport(4.2.6) lib / active_support / notifications.rb:166:in
actionview (4.2.6) lib/action_view/template.rb:145:ininstrument' 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'
工具' actionview(4.2.6) lib / action_view / renderer / abstract_renderer.rb:39:在render_template中的
activesupport (4.2.6) lib/active_support/notifications.rb:164:ininstrument'
块中' actionview(4.2.6) LIB / ACTION_VIEW /渲染器/ template_renderer.rb:61:在
actionview (4.2.6) lib/action_view/renderer/template_renderer.rb:53:inrender_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:inrender' 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:inrender' 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'
render_to_body' actionpack(4.2.6)lib / action_controller / metal / rendering.rb:32:in
actionview (4.2.6) lib/action_view/rendering.rb:83:inrender_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:inrender' 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:inrealtime' 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:inrender_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'
respond_with'设计(4.2.0) app / controllers / devise / sessions_controller.rb:12:在'new'
responders (2.2.0) lib/action_controller/respond_with.rb:205:in
这些是我面临的错误:
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" }
它在旧版本中工作,所以我没有改变路线。 请帮忙