For some reason my autoloader isn’t working, i followed some tutorials, here is what my config\application.rb file looks like
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)
I am getting this error:
uninitialized constant ActionView::CompiledTemplates::PaginationListLinkRenderer
Here is my lib\paginationlistlinkrenderer.rb code
class PaginationListLinkRenderer < WillPaginate::ViewHelpers::LinkRenderer
protected
...
...
end
Here is my index.html.erb
<div id="img_content">
<%= render @posts%>
</div>
<%= will_paginate(@posts, :renderer => PaginationListLinkRenderer) %>
<%= link_to "New Quote", new_post_path %>
I just need to get this file to pre-load so my controller will recognize it. Any ideas?
In your config/initializers folder make a file called pagination.rb and include the following. Restart and it should work.
Change you Lib pagination File to…
Make sure you have the latest version of Will_Pagination. Version 3 Pre