Jquery 咖啡架上的意外凹痕?

Jquery 咖啡架上的意外凹痕?,jquery,ruby-on-rails,coffeescript,Jquery,Ruby On Rails,Coffeescript,我试图使用will_paginate和coffee在rails中进行无限滚动,在我编写代码之后,它给了我这个错误 我使用ATOM作为我的IDE 在more\u posts\u url变量之后有一个额外的缩进块: if $('#infinite-scrolling').size() > 0 $(window).on 'scroll', -> more_posts_url = $('.pagination .next_page a').attr('href') if

我试图使用will_paginate和coffee在rails中进行无限滚动,在我编写代码之后,它给了我这个错误


我使用ATOM作为我的IDE 在more\u posts\u url变量之后有一个额外的缩进块:

if $('#infinite-scrolling').size() > 0
  $(window).on 'scroll', ->
    more_posts_url = $('.pagination .next_page a').attr('href')
    if more_posts_url && $(window).scrollTop() > $(document).height() - $(window).height() - 60
      $('.pagination').html('<p> loading <p>')
      $.getScript more_posts_url
    return
  return
if$('#无限滚动').size()>0
$(窗口)。在“滚动”上,->
更多帖子\u url=$('.pagination.next_page a').attr('href'))
如果有更多的帖子,url&&$(窗口).scrollTop()>$(文档).height()-$(窗口).height()-60
$('.pagination').html('正在加载'))
$.getScript更多帖子\u url
返回
返回
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
  if $('#infinite-scrolling').size() > 0
    $(window).on 'scroll', ->
      more_posts_url = $('.pagination .next_page a').attr('href')
        if more_posts_url && $(window).scrollTop() > $(document).height() - $(window).height() - 60
            $('.pagination').html('<p> loading <p>')
            $.getScript more_posts_url
        return
      return
if $('#infinite-scrolling').size() > 0
  $(window).on 'scroll', ->
    more_posts_url = $('.pagination .next_page a').attr('href')
    if more_posts_url && $(window).scrollTop() > $(document).height() - $(window).height() - 60
      $('.pagination').html('<p> loading <p>')
      $.getScript more_posts_url
    return
  return