スプリー1.3.1の管理セクションにカスタムコントローラーを追加しようとしていますが、失敗しました。トップメニューにcontoller.index.htmlへのURLを表示したい。私はそれをしました:
/controllers/spree/admin/parsers_controller.rb:
module Spree
module Admin
#class ParsersController < Spree::Admin::BaseController
class ParsersController < Spree::Admin::ResourceController
def index
end
end
end
end
改ざん:
Deface::Override.new(:virtual_path => "spree/layouts/admin",
:name => "admin_content_admin_tab_parser",
:insert_bottom => "[data-hook='admin_tabs']",
:text => "<%= tab :parsers, :url => spree.admin_parsers_path, :icon => 'icon-th-large' %>",
:disabled => false)
ルート.rb:
Spree::Core::Engine.routes.prepend do
namespace :admin do
resources :parsers
end
end
index.html.erb
<h1>Parser index.html</h1>
そして、私はエラーが発生しています:
領収書にも同じエラーが表示されます。
NoMethodError in Spree/admin/overview#index
Showing /home/ssa/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/spree_core-1.3.1/app/views/spree/layouts/admin.html.erb where line #54 raised:
undefined method `admin_parsers_path' for #<ActionDispatch::Routing::RoutesProxy:0x0000000612a560>
Extracted source (around line #54):
51: <div class="sixteen columns main-menu-wrapper">
52: <ul data-hook="admin_tabs" class="inline-menu fullwidth-menu">
53: <%= render :partial => 'spree/admin/shared/tabs' %>
54: <%= tab(:promotions, :url => spree.admin_promotions_path, :icon => 'icon-bullhorn') %><%= tab(:users, :url => spree.admin_users_path, :icon => 'icon-user') %><%= tab :parsers, :url => spree.admin_parsers_path, :icon => 'icon-th-large' %>
55: </ul>
56: </div>
57: </div>
私は何を間違えますか?