Requirements: Get coffee-script installed (refer above)
Ref: http://babinho.net/2011/05/autocomplete-fields-in-rails-3-1-with-jquery-ui/
To use this I had to download jquery-ui (http://jqueryui.com/download) and select Autocomplete
(function() { | |
var anchoredLink, assets, assetsChanged, browserCompatibleDocumentParser, browserSupportsPushState, cacheCurrentPage, changePage, constrainPageCacheTo, createDocument, crossOriginLink, currentState, executeScriptTags, extractAssets, extractLink, extractTitleAndBody, fetchHistory, fetchReplacement, handleClick, ignoreClick, initialized, installClickHandlerLast, intersection, noTurbolink, nonHtmlLink, nonStandardClick, pageCache, recallScrollPosition, referer, reflectNewUrl, reflectRedirectedUrl, rememberCurrentAssets, rememberCurrentState, rememberCurrentUrl, rememberInitialPage, resetScrollPosition, samePageLink, triggerEvent, visit, | |
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | |
initialized = false; | |
currentState = null; | |
referer = document.location.href; |
/*! jQuery UI - v1.9.2 - 2013-02-12 | |
* http://jqueryui.com | |
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css | |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CHelvetica%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=dddddd&bgTextureHeader=glass&bgImgOpacityHeader=35&borderColorHeader=bbbbbb&fcHeader=444444&iconColorHeader=999999&bgColorContent=c9c9c9&bgTextureContent=inset_soft&bgImgOpacityContent=50&borderColorContent=aaaaaa&fcContent=333333&iconColorContent=999999&bgColorDefault=eeeeee&bgTextureDefault=glass&bgImgOpacityDefault=60&borderColorDefault=cccccc&fcDefault=3383bb&iconColorDefault=70b2e1&bgColorHover=f8f8f8&bgTextureHover=glass&bgI |
/* | |
* Unobtrusive autocomplete | |
* | |
* To use it, you just have to include the HTML attribute autocomplete | |
* with the autocomplete URL as the value | |
* | |
* Example: | |
* <input type="text" data-autocomplete="/url/to/autocomplete"> | |
* | |
* Optionally, you can use a jQuery selector to specify a field that can |
require 'csv' | |
desc "Imports a CSV file into local or production database" | |
task :import, [:filename] => :environment do | |
CSV.foreach('public/cats.csv', :headers => true) do |row| | |
Category.find_or_create_by_description(row.to_hash) | |
end | |
end |
/* | |
* Unobtrusive autocomplete | |
* | |
* To use it, you just have to include the HTML attribute autocomplete | |
* with the autocomplete URL as the value | |
* | |
* Example: | |
* <input type="text" data-autocomplete="/url/to/autocomplete"> | |
* | |
* Optionally, you can use a jQuery selector to specify a field that can |
Requirements: Get coffee-script installed (refer above)
Ref: http://babinho.net/2011/05/autocomplete-fields-in-rails-3-1-with-jquery-ui/
To use this I had to download jquery-ui (http://jqueryui.com/download) and select Autocomplete
$("#add-item").click(function() { | |
var divs = document.getElementsByClassName('budget-field'); | |
var divs2 = document.getElementsByClassName('mini-field'); | |
var divs3 = document.getElementsByClassName('text-area'); | |
var divs4 = document.getElementsByClassName('check-box'); | |
var divs5 = document.getElementsByTagName('select'); | |
for (i = 0; i < divs.length; i++) { | |
divs[i].setAttribute('readonly',true); |
set :application, "gppb" | |
set :repository, "git@github.com:AppSource/gppb.git" | |
set :scm, :git | |
set :user, "gppb.com" | |
set :deploy_to, "/home/gppb.com/apps/#{application}" | |
set :use_sudo, false | |
set :keep_releases, 5 | |
set :normalize_asset_timestamps, false | |
# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names | |
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` |
source 'https://rubygems.org' | |
gem 'rails', '3.2.11' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'bootstrap-sass', '2.1' | |
gem 'twitter-bootstrap-rails' | |
gem 'pg' |
# Flashing Message | |
# Fade flash message | |
$(document).ready -> | |
$(".alert").fadeOut 4000 | |
$(".alert").mouseenter -> | |
$(".alert").stop() |