This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.Diseases = function() { | |
this._input = $('#diseases-search-txt'); | |
this._initAutocomplete(); | |
}; | |
app.Diseases.prototype = { | |
_initAutocomplete: function() { | |
this._input | |
.autocomplete({ | |
source: '/diseases', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DiseasesController < ApplicationController | |
before_action :set_disease, only: [:show, :edit, :update, :destroy] | |
def index | |
respond_to do |format| | |
format.html | |
format.json { @diseases = Disease.search(params[:term]) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { // wait for document ready | |
// init | |
var controller = new ScrollMagic.Controller({ | |
globalSceneOptions: { | |
triggerHook: 'onLeave' | |
} | |
}); | |
// get all slides | |
var slides = document.querySelectorAll("section.panel"); |