3

我正在尝试让 ajax 分页在 Heroku 上的生产环境中与 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"}

事件控制器

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
4

0 回答 0