Skip to content

Commit d0a0606

Browse files
committed
Merge pull request #205 from zlx/feature/399-autocomplete
Feature/399 autocomplete
2 parents c37f17a + 65e9a47 commit d0a0606

File tree

75 files changed

+998
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+998
-0
lines changed

soffolk/399_autocomplete/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile ~/.gitignore_global
6+
7+
# Ignore bundler config
8+
/.bundle
9+
10+
# Ignore the default SQLite database.
11+
/db/*.sqlite3
12+
13+
# Ignore all logfiles and tempfiles.
14+
/log/*.log
15+
/tmp

soffolk/399_autocomplete/Gemfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
source 'http://ruby.taobao.org'
2+
3+
gem 'rails', '3.2.9'
4+
5+
# Bundle edge Rails instead:
6+
# gem 'rails', :git => 'git://github.com/rails/rails.git'
7+
8+
gem 'sqlite3'
9+
10+
11+
# Gems used only for assets and not required
12+
# in production environments by default.
13+
group :assets do
14+
gem 'sass-rails', '~> 3.2.3'
15+
gem 'coffee-rails', '~> 3.2.1'
16+
17+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
18+
# gem 'therubyracer', :platforms => :ruby
19+
20+
gem 'uglifier', '>= 1.0.3'
21+
end
22+
23+
gem 'jquery-rails'
24+
25+
# To use ActiveModel has_secure_password
26+
# gem 'bcrypt-ruby', '~> 3.0.0'
27+
28+
# To use Jbuilder templates for JSON
29+
# gem 'jbuilder'
30+
31+
# Use unicorn as the app server
32+
# gem 'unicorn'
33+
34+
# Deploy with Capistrano
35+
# gem 'capistrano'
36+
37+
# To use debugger
38+
# gem 'debugger'
39+
gem 'rack-mini-profiler'
40+
gem 'redis'

soffolk/399_autocomplete/Gemfile.lock

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
GEM
2+
remote: http://ruby.taobao.org/
3+
specs:
4+
actionmailer (3.2.9)
5+
actionpack (= 3.2.9)
6+
mail (~> 2.4.4)
7+
actionpack (3.2.9)
8+
activemodel (= 3.2.9)
9+
activesupport (= 3.2.9)
10+
builder (~> 3.0.0)
11+
erubis (~> 2.7.0)
12+
journey (~> 1.0.4)
13+
rack (~> 1.4.0)
14+
rack-cache (~> 1.2)
15+
rack-test (~> 0.6.1)
16+
sprockets (~> 2.2.1)
17+
activemodel (3.2.9)
18+
activesupport (= 3.2.9)
19+
builder (~> 3.0.0)
20+
activerecord (3.2.9)
21+
activemodel (= 3.2.9)
22+
activesupport (= 3.2.9)
23+
arel (~> 3.0.2)
24+
tzinfo (~> 0.3.29)
25+
activeresource (3.2.9)
26+
activemodel (= 3.2.9)
27+
activesupport (= 3.2.9)
28+
activesupport (3.2.9)
29+
i18n (~> 0.6)
30+
multi_json (~> 1.0)
31+
arel (3.0.2)
32+
builder (3.0.4)
33+
coffee-rails (3.2.2)
34+
coffee-script (>= 2.2.0)
35+
railties (~> 3.2.0)
36+
coffee-script (2.2.0)
37+
coffee-script-source
38+
execjs
39+
coffee-script-source (1.4.0)
40+
erubis (2.7.0)
41+
execjs (1.4.0)
42+
multi_json (~> 1.0)
43+
hike (1.2.1)
44+
i18n (0.6.1)
45+
journey (1.0.4)
46+
jquery-rails (2.1.4)
47+
railties (>= 3.0, < 5.0)
48+
thor (>= 0.14, < 2.0)
49+
json (1.7.6)
50+
mail (2.4.4)
51+
i18n (>= 0.4.0)
52+
mime-types (~> 1.16)
53+
treetop (~> 1.4.8)
54+
mime-types (1.19)
55+
multi_json (1.5.0)
56+
polyglot (0.3.3)
57+
rack (1.4.1)
58+
rack-cache (1.2)
59+
rack (>= 0.4)
60+
rack-mini-profiler (0.1.26)
61+
rack (>= 1.1.3)
62+
rack-ssl (1.3.2)
63+
rack
64+
rack-test (0.6.2)
65+
rack (>= 1.0)
66+
rails (3.2.9)
67+
actionmailer (= 3.2.9)
68+
actionpack (= 3.2.9)
69+
activerecord (= 3.2.9)
70+
activeresource (= 3.2.9)
71+
activesupport (= 3.2.9)
72+
bundler (~> 1.0)
73+
railties (= 3.2.9)
74+
railties (3.2.9)
75+
actionpack (= 3.2.9)
76+
activesupport (= 3.2.9)
77+
rack-ssl (~> 1.3.2)
78+
rake (>= 0.8.7)
79+
rdoc (~> 3.4)
80+
thor (>= 0.14.6, < 2.0)
81+
rake (10.0.3)
82+
rdoc (3.12)
83+
json (~> 1.4)
84+
redis (3.0.4)
85+
sass (3.2.4)
86+
sass-rails (3.2.5)
87+
railties (~> 3.2.0)
88+
sass (>= 3.1.10)
89+
tilt (~> 1.3)
90+
sprockets (2.2.2)
91+
hike (~> 1.2)
92+
multi_json (~> 1.0)
93+
rack (~> 1.0)
94+
tilt (~> 1.1, != 1.3.0)
95+
sqlite3 (1.3.6)
96+
thor (0.16.0)
97+
tilt (1.3.3)
98+
treetop (1.4.12)
99+
polyglot
100+
polyglot (>= 0.3.1)
101+
tzinfo (0.3.35)
102+
uglifier (1.3.0)
103+
execjs (>= 0.3.0)
104+
multi_json (~> 1.0, >= 1.0.2)
105+
106+
PLATFORMS
107+
ruby
108+
109+
DEPENDENCIES
110+
coffee-rails (~> 3.2.1)
111+
jquery-rails
112+
rack-mini-profiler
113+
rails (= 3.2.9)
114+
redis
115+
sass-rails (~> 3.2.3)
116+
sqlite3
117+
uglifier (>= 1.0.3)

soffolk/399_autocomplete/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RailsCasts Example Application
2+
3+
Run these commands to try it out.
4+
5+
```
6+
bundle
7+
rake db:setup
8+
rails s
9+
```
10+
11+
Requires Ruby 1.9.2 or later to run.

soffolk/399_autocomplete/Rakefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env rake
2+
# Add your own tasks in files placed in lib/tasks ending in .rake,
3+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4+
5+
require File.expand_path('../config/application', __FILE__)
6+
7+
Store::Application.load_tasks
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// the compiled file.
9+
//
10+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11+
// GO AFTER THE REQUIRES BELOW.
12+
//
13+
//= require jquery
14+
//= require jquery-ui
15+
//= require jquery_ujs
16+
//= require_tree .
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
4+
5+
$ ->
6+
$("#search").autocomplete
7+
source: "/search_suggustions"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the top of the
9+
* compiled file, but it's generally better to create a new file per style scope.
10+
*
11+
*= require_self
12+
*= require_tree .
13+
*/
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
html, body {
2+
background-color: #4B7399;
3+
font-family: Verdana, Helvetica, Arial;
4+
font-size: 14px;
5+
}
6+
7+
a {
8+
color: #0000FF;
9+
img { border: none; }
10+
}
11+
12+
.clear {
13+
clear: both;
14+
height: 0;
15+
overflow: hidden;
16+
}
17+
18+
#container {
19+
width: 80%;
20+
margin: 0 auto;
21+
background-color: #FFF;
22+
padding: 20px 40px;
23+
border: solid 1px black;
24+
margin-top: 20px;
25+
}
26+
27+
#flash_notice {
28+
color: #00B205;
29+
}
30+
31+
#flash_alert {
32+
color: #D00;
33+
}
34+
35+
.error_messages, #error_explanation {
36+
width: 400px;
37+
border: 2px solid #CF0000;
38+
padding: 0px;
39+
padding-bottom: 12px;
40+
margin-bottom: 20px;
41+
background-color: #f0f0f0;
42+
font-size: 12px;
43+
44+
h2 {
45+
text-align: left;
46+
font-weight: bold;
47+
padding: 5px 10px;
48+
font-size: 12px;
49+
margin: 0;
50+
background-color: #c00;
51+
color: #fff;
52+
}
53+
54+
p { margin: 8px 10px; }
55+
ul { margin-bottom: 0; }
56+
}
57+
58+
.field_with_errors {
59+
display: inline;
60+
}
61+
62+
form .field, form .actions {
63+
margin: 12px 0;
64+
}
65+
66+
h2 {
67+
font-size: 18px;
68+
margin-top: 20px;
69+
margin-bottom: 5px;
70+
}

0 commit comments

Comments
 (0)