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); |
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
/* | |
* 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 |
/*! 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 |
(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; |
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
config.action_mailer.default_url_options = { :host => 'localhost:3000' } | |
config.action_mailer.delivery_method = :smtp | |
config.action_mailer.smtp_settings = { | |
address: "smtp.gmail.com", | |
port: 587, | |
domain: 'gmail.com', | |
authentication: "plain", | |
enable_starttls_auto: true, |