首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RefineryCMS: portfolio图库插件引入的路由错误

RefineryCMS: portfolio图库插件引入的路由错误
EN

Stack Overflow用户
提问于 2015-09-30 13:40:49
回答 1查看 183关注 0票数 0

我正在使用RefineryCMS作为一个rails CMS,它的工作就像一种魅力,直到我按照问题中的答案来获得一个简单的图片库功能。现在,我得到了与问题相同的错误。但是,我没有修改任何rails代码来引入带有零引用的link_to标记(指南中有一个link_to image_tag行,但我已经注释了out,没有什么改变),所以我相信这是在自动生成的代码中发生的。以下是我登录到我的站点上的炼油厂时所遇到的全部错误:

代码语言:javascript
复制
ActionController::UrlGenerationError in Refinery::Authentication::Devise::Admin::Users#index
Showing /home/mpvoss/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-0a37f8090278/core/app/views/refinery/admin/_menu_item.html.erb where line #1 raised:

No route matches {:action=>"index", :controller=>"refinery/refinery/portfolio/admin/galleries", :locale=>:en}
Extracted source (around line #46):            
44 message << " missing required keys: #{missing_keys.sort.inspect}"     unless missing_keys.empty?
45
46 raise ActionController::UrlGenerationError, message
47 end
48
49 def clear

Trace of template inclusion: /home/mpvoss/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-0a37f8090278/core/app/views/refinery/admin/_menu.html.erb, /home/mpvoss/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-0a37f8090278/core/app/views/layouts/refinery/admin.html.erb

注意:只是加载网站,而没有登录到炼油厂工作,因为它没有试图加载下面的菜单代码,遇到路由问题。

好吧,让我们看看_menu.html.erb

代码语言:javascript
复制
<%= link_to menu_item.title, refinery.url_for(menu_item.url),
        :class => ("active" if menu_item.highlighted?(params)),
        :id => "plugin_#{menu_item.name}" %>

这段代码只是为所有插件制作了一个菜单栏。它可以被注释掉和炼油厂工程(上面的错误消失),但我需要那个菜单栏,以作出更改的网站。

我试过的

  • 我在~/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-portfolio-289b85b18771/app/controllers/refinery/portfolio/admin,中找到了一个galleries_controller.rb,它似乎是错误讨论的控制器。它没有索引操作,所以我添加了一个空操作,以查看这是否是问题所在,没有任何变化。~/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-portfolio-289b85b18771/宝石的routes.rb如下所示
  • 注释掉Gemfile中的portfolio并运行bundle安装,但我得到了相同的错误,因为自动生成的代码(引用.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-0a37f8090278/)之类的东西)仍然被执行(我使用git进行版本控制,并在这些更改之前对项目进行干净的克隆,而且由于自动生成的代码不是版本控件的一部分,所以它也有相同的问题)。
  • gem卸载精炼厂-照片库,精化-页面-图片和精炼-投资组合宝石,我认为可能是造成问题。
  • 我将~/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/中的所有gems移出该目录,以查看包安装是否会重新生成新鲜、干净的gems,但没有任何改变。

这些想法都不起作用。如果需要澄清,请告诉我。一个星期以来,我一直被困在这个问题上,而我的谷歌搜索能力也让我失望了。任何帮助都是非常感谢的!

~/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-portfolio-289b85b18771/routes.rb

代码语言:javascript
复制
 Refinery::Core::Engine.routes.draw do

  # Frontend routes
  namespace :portfolio, :path => Refinery::Portfolio.page_url do
    root :to => "galleries#index"
    resources :galleries, :only => [:index, :show]
  end

  # Admin routes
  namespace :portfolio, :path => '' do
    namespace :admin, :path => Refinery::Core.backend_route do
      scope :path => 'portfolio' do
        resources :galleries, :except => :show do
          get :children, :on => :member
          post :update_positions, :on => :collection
          resources :items, :except => [:show] do
            post :update_positions, :on => :collection
          end
        end
        resources :items do
          post :update_positions, :on => :collection
        end
      end
    end
  end
end

Gemfile

代码语言:javascript
复制
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3'
# Use sqlite3 as the database for Active Record
group :development, :test do
  gem 'sqlite3'
end
# Use SCSS for stylesheets
# Use Uglifier as compressor for JavaScript assets
# Use CoffeeScript for .coffee assets and views
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more:     https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger     console
  gem 'byebug'

  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the     background. Read more: https://github.com/rails/spring
  gem 'spring'
end

# Added by Matthew, Thin server
gem 'faye'
gem 'thin'

group :assets do
  #gem 'sass-rails', '~> 3.2.3'
  gem 'coffee-rails', '~> 4.1.0'
  gem 'sass-rails', '~> 5.0'
  #gem 'coffee-rails', '~> 3.2.1'
  gem 'bootstrap-sass','~> 3.1.1'
  gem 'uglifier', '>= 1.3.0'
  #gem 'uglifier', '>= 1.0.3'
end

  gem 'twitter-bootstrap-rails'
gem 'refinerycms', git: 'https://github.com/refinery/refinerycms', branch: 'master'
#gem 'refinerycms-page-images', '~> 2.0.0'
gem 'quiet_assets', group: :development
#gem 'refinerycms-photo-gallery', '~> 0.1.0'
# Add support for searching inside Refinery's admin interface.
gem 'refinerycms-acts-as-indexed', ['~> 2.0', '>= 2.0.0']

# Add support for Refinery's custom fork of the visual editor WYMeditor.
gem 'refinerycms-wymeditor', ['~> 1.0', '>= 1.0.6']
gem 'refinerycms-portfolio', github: 'refinery/refinerycms-portfolio', branch:     'master'
# The default authentication adapter
gem 'refinerycms-authentication-devise', '~> 1.0'
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-04 03:13:37

看起来这是portfolio/images插件中的一个bug,尝试了另一个包更新,更新后的代码就像一种魅力。<3 RefineryCMS贡献者

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32867656

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档