出于某种原因,我的自动加载磁带机不工作,我跟着一些教程,这里是我的配置\ application.rb中的文件是什么样子的Rails:自动加载的lib不工作
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Quotes
class Application < Rails::Application
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
config.autoload_paths += %W(#{config.root}/lib)
我收到此错误: 未初始化的常量::的ActionView :: CompiledTemplates PaginationListLinkRenderer
这里是我的lib \ paginationlistlinkrenderer.rb代码
class PaginationListLinkRenderer < WillPaginate::ViewHelpers::LinkRenderer
protected
...
...
end
这里是我的索引。 html.erb
<div id="img_content">
<%= render @posts%>
</div>
<%= will_paginate(@posts, :renderer => PaginationListLinkRenderer) %>
<%= link_to "New Quote", new_post_path %>
我只是需要让这个文件预加载,所以我的控制器会识别它。有任何想法吗?
嗯,没有工作,仍然有同样的错误 – yoshyosh 2011-05-25 09:42:45
我已经编辑了上述内容。给它一个去,让我知道。 – CharlesJHardy 2011-05-25 09:55:44
很好,工作,什么事情发生? = /如此困惑lol – yoshyosh 2011-05-25 10:17:41