未定义的方法`paginate' kaminari-mongoid rails 5

时间:2017-02-14 02:49:57

标签: mongodb mongoid ruby-on-rails-5 kaminari

使用monogid 6.0.0和rails 5

这是我的控制者:

def index
    @images = Image.page(7).per(50).padding(3)
end

并查看:

<% @images.each do |image| %>
   <tr>
      <td><%= image.image %></td>
      <td><%= image.mime %></td>
      <td><%= image.user_id %></td>
      <td><%= image.product_ids %></td>
      <td><%= image.updated_at %></td>
      <td><%= image.created_at %></td>
      <td><%= link_to 'Show', image %></td>
      <td><%= link_to 'Edit', edit_image_path(image) %></td>
      <td><%= link_to 'Destroy', image, method: :delete, data: { confirm: 'Are you sure?' } %></td>
   </tr>

<% end %>
<%= paginate @images %>

追踪:

  

actionview(5.0.1)lib / action_view / template.rb:159:在block in render' activesupport (5.0.1) lib/active_support/notifications.rb:166:in工具&#39;的ActionView   (5.0.1)lib / action_view / template.rb:354:在instrument' actionview (5.0.1) lib/action_view/template.rb:157:in渲染&#39; actionview(5.0.1)   lib / action_view / renderer / template_renderer.rb:54:在block (2 levels) in render_template' actionview (5.0.1) lib/action_view/renderer/abstract_renderer.rb:42:in块中   仪器&#39; activesupport(5.0.1)   lib / active_support / notifications.rb:164:in block in instrument' activesupport (5.0.1) lib/active_support/notifications/instrumenter.rb:21:in instrument&#39;   activesupport(5.0.1)lib / active_support / notifications.rb:164:in   instrument' actionview (5.0.1) lib/action_view/renderer/abstract_renderer.rb:41:in仪器&#39;   actionview(5.0.1)lib / action_view / renderer / template_renderer.rb:53:in   block in render_template' actionview (5.0.1) lib/action_view/renderer/template_renderer.rb:61:in render_with_layout&#39; actionview(5.0.1)   lib / action_view / renderer / template_renderer.rb:52:在render_template' actionview (5.0.1) lib/action_view/renderer/template_renderer.rb:14:in 渲染&#39; actionview(5.0.1)lib / action_view / renderer / renderer.rb:42:in   render_template' actionview (5.0.1) lib/action_view/renderer/renderer.rb:23:in渲染&#39; actionview(5.0.1)   lib / action_view / rendering.rb:103:在_render_template' actionpack (5.0.1) lib/action_controller/metal/streaming.rb:217:in _ render_template&#39; actionview(5.0.1)   lib / action_view / rendering.rb:83:在render_to_body' actionpack (5.0.1) lib/action_controller/metal/rendering.rb:52:in render_to_body&#39;   actionpack(5.0.1)lib / action_controller / metal / renderers.rb:142:in   render_to_body' actionpack (5.0.1) lib/abstract_controller/rendering.rb:26:in渲染&#39; actionpack(5.0.1)   lib / action_controller / metal / rendering.rb:36:在render' actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:44:in块中(2   渲染&#39; activesupport(5.0.1)   lib / active_support / core_ext / benchmark.rb:12:in block in ms' /home/draf/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in 实时&#39; activesupport(5.0.1)   lib / active_support / core_ext / benchmark.rb:12:在ms' actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:44:in块中渲染&#39;   actionpack(5.0.1)   LIB / action_controller /金属/ instrumentation.rb:87:在   cleanup_view_runtime' actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:43:in渲染&#39;   actionpack(5.0.1)   lib / action_controller / metal / implicit_render.rb:36:在default_render' actionpack (5.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in块中   send_action&#39; actionpack(5.0.1)   lib / action_controller / metal / basic_implicit_render.rb:4:在tap' actionpack (5.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in send_action&#39; actionpack(5.0.1)   lib / abstract_controller / base.rb:188:在process_action' actionpack (5.0.1) lib/action_controller/metal/rendering.rb:30:in process_action&#39; actionpack(5.0.1)   lib / abstract_controller / callbacks.rb:20:in block in process_action' activesupport (5.0.1) lib/active_support/callbacks.rb:126:in call&#39;   activesupport(5.0.1)lib / active_support / callbacks.rb:506:in block (2 levels) in compile' activesupport (5.0.1) lib/active_support/callbacks.rb:455:in call&#39; activesupport(5.0.1)   lib / active_support / callbacks.rb:101:在__run_callbacks__' activesupport (5.0.1) lib/active_support/callbacks.rb:750:in _ run_process_action_callbacks&#39; activesupport(5.0.1)   lib / active_support / callbacks.rb:90:在run_callbacks' actionpack (5.0.1) lib/abstract_controller/callbacks.rb:19:in process_action&#39;   actionpack(5.0.1)lib / action_controller / metal / rescue.rb:20:in   process_action' actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:32:in阻止   process_action&#39; activesupport(5.0.1)   lib / active_support / notifications.rb:164:in block in instrument' activesupport (5.0.1) lib/active_support/notifications/instrumenter.rb:21:in instrument&#39;   activesupport(5.0.1)lib / active_support / notifications.rb:164:in   instrument' actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:30:in process_action&#39;   actionpack(5.0.1)   lib / action_controller / metal / params_wrapper.rb:248:process_action' actionpack (5.0.1) lib/abstract_controller/base.rb:126:in进程&#39;   actionview(5.0.1)lib / action_view / rendering.rb:30:在process' actionpack (5.0.1) lib/action_controller/metal.rb:190:in发送&#39;   actionpack(5.0.1)lib / action_controller / metal.rb:262:在dispatch' actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:50:in 发送&#39; actionpack(5.0.1)   lib / action_dispatch / routing / route_set.rb:32:在serve' actionpack (5.0.1) lib/action_dispatch/journey/router.rb:39:in块中的服务&#39;   actionpack(5.0.1)lib / action_dispatch / journey / router.rb:26:in each' actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in serve&#39;   actionpack(5.0.1)lib / action_dispatch / routing / route_set.rb:725:in   call' rack (2.0.1) lib/rack/etag.rb:25:in呼叫&#39;机架(2.0.1)   lib / rack / conditional_get.rb:25:in call' rack (2.0.1) lib/rack/head.rb:12:in来电&#39;机架(2.0.1)   lib / rack / session / abstract / id.rb:222:context' rack (2.0.1) lib/rack/session/abstract/id.rb:216:in来电&#39; actionpack(5.0.1)   lib / action_dispatch / middleware / cookies.rb:613:在call' actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in块中   叫&#39; activesupport(5.0.1)lib / active_support / callbacks.rb:97:in   __run_callbacks__' activesupport (5.0.1) lib/active_support/callbacks.rb:750:in _ run_call_callbacks&#39;   activesupport(5.0.1)lib / active_support / callbacks.rb:90:in   run_callbacks' actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in呼叫&#39; ActionPack的   (5.0.1)lib / action_dispatch / middleware / executor.rb:12:在call' actionpack (5.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in 电话&#39; actionpack(5.0.1)   lib / action_dispatch / middleware / debug_exceptions.rb:49:in call' web-console (3.4.0) lib/web_console/middleware.rb:135:in call_app&#39;   web-console(3.4.0)lib / web_console / middleware.rb:28:in block in call' web-console (3.4.0) lib/web_console/middleware.rb:18:in catch&#39;   web-console(3.4.0)lib / web_console / middleware.rb:18:in call' actionpack (5.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in call&#39;   railties(5.0.1)lib / rails / rack / logger.rb:36:in call_app' railties (5.0.1) lib/rails/rack/logger.rb:24:in阻止通话&#39;的ActiveSupport   (5.0.1)lib / active_support / tagged_logging.rb:69:在block in tagged' activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in 标记的&#39; activesupport(5.0.1)   lib / active_support / tagged_logging.rb:69:in tagged' railties (5.0.1) lib/rails/rack/logger.rb:24:in来电&#39;链轮导轨(3.2.0)   lib / sprockets / rails / quiet_assets.rb:13:in call' actionpack (5.0.1) lib/action_dispatch/middleware/request_id.rb:24:in call&#39;机架(2.0.1)   lib / rack / method_override.rb:22:call' rack (2.0.1) lib/rack/runtime.rb:22:in来电&#39; activesupport(5.0.1)   LIB / active_support /缓存/策略/ local_cache_middleware.rb:28:在   call' actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in呼叫&#39; ActionPack的   (5.0.1)lib / action_dispatch / middleware / static.rb:136:在call' rack (2.0.1) lib/rack/sendfile.rb:111:in电话&#39;铁路(5.0.1)   lib / rails / engine.rb:522:在call' puma (3.7.0) lib/puma/configuration.rb:226:in来电&#39;美洲狮(3.7.0)   lib / puma / server.rb:578:在handle_request' puma (3.7.0) lib/puma/server.rb:415:in process_client&#39;美洲狮(3.7.0)   lib / puma / server.rb:275:在spawn_thread的block in run' puma (3.7.0) lib/puma/thread_pool.rb:120:in块中&#39;

0 个答案:

没有答案