我正试图在Heroku的生产环境中使用ajax分页与Kaminari合作。目前在开发模式下本地运行代码似乎都可行。我似乎无法找到导致它在本地工作的原因,而不是在生产中
控制台输出
Started GET "/events/page/2" for 127.0.0.1 at 2013-04-02 21:48:33 +1100
Processing by EventsController#index as JS
Parameters: {"event_page"=>"2"}
events_controller
def index
@events = Event.all
respond_to do |format|
format.html # index.html.haml
format.json
format.js
end
end
index.js.haml
$('#events').html('#{escape_javascript render('events_list')}');
$('#events_page').html('#{escape_javascript render('paginator')}');
$('#event_counter').html('(#{pluralize(@events.count, 'event')})');
index.html.haml
%section.section
%p.title= link_to 'List View', '#events'
.content{'data-slug'=>'events'}
%p#events= render 'events/events_list'
= render 'events/paginator'
heroku日志
2013-04-02T10:29:39+00:00 app[web.1]: Started GET "/events/page/2" for 203.206.108.64 at
2013-04-02 10:29:38 +0000
2013-04-02T10:29:39+00:00 app[web.1]:
2013-04-02T10:29:39+00:00 app[web.1]:
2013-04-02T10:29:39+00:00 heroku[router]: at=info method=GET path=/events/page/2 host=www.*****.com.au fwd="203.206.108.64" dyno=web.1 connect=2ms service=1062ms status=304 bytes=0