Skip to content

Instantly share code, notes, and snippets.

View jordanthomas's full-sized avatar
✌️
v chill

Jordan Thomas jordanthomas

✌️
v chill
View GitHub Profile
@jordanthomas
jordanthomas / newbs.js
Created August 6, 2015 20:19 — forked from overwine/newbs.js
Scroll up and scroll down detection + animation
var lastScrollTop = $(window).scrollTop();
$(window).scroll(function(event){
var currentScrollTop = $(window).scrollTop();
var scrollingUp = currentScrollTop > lastScrollTop;
var $filter = $('.top-filter');
if (scrollingUp) {
animating = true;
class CommentsController < ApplicationController
respond_to :html, :json
def create
@report = Report.find(params[:report_id])
@comment = @report.comments.build(params[:comment])
@comment.user = current_user
respond_with @report, @comment, :methods => [:by_admin?]
end
end