rails3-jquery-autocomplete 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG.md → CHANGELOG.MD} +1 -0
- data/README.markdown +4 -1
- data/lib/generators/templates/autocomplete-rails-uncompressed.js +1 -1
- data/lib/generators/templates/autocomplete-rails.js +1 -1
- data/lib/rails3-jquery-autocomplete.rb +1 -1
- data/lib/rails3-jquery-autocomplete/form_helper.rb +1 -0
- data/lib/rails3-jquery-autocomplete/formtastic_plugin.rb +3 -4
- data/lib/rails3-jquery-autocomplete/version.rb +1 -1
- metadata +10 -104
- data/.document +0 -5
- data/.gitignore +0 -26
- data/Gemfile +0 -18
- data/integration/.gitignore +0 -2
- data/integration/.rspec +0 -1
- data/integration/Gemfile +0 -18
- data/integration/README +0 -256
- data/integration/Rakefile +0 -7
- data/integration/app/controllers/application_controller.rb +0 -3
- data/integration/app/controllers/autocomplete_controller.rb +0 -7
- data/integration/app/controllers/id_elements_controller.rb +0 -8
- data/integration/app/controllers/multiple_selections_controller.rb +0 -7
- data/integration/app/controllers/nested_models_controller.rb +0 -8
- data/integration/app/controllers/scoped_autocompletes_controller.rb +0 -7
- data/integration/app/controllers/simple_forms_controller.rb +0 -7
- data/integration/app/controllers/sub_classes_controller.rb +0 -7
- data/integration/app/helpers/application_helper.rb +0 -2
- data/integration/app/helpers/autocomplete_helper.rb +0 -2
- data/integration/app/helpers/error_messages_helper.rb +0 -23
- data/integration/app/helpers/id_elements_helper.rb +0 -2
- data/integration/app/helpers/layout_helper.rb +0 -22
- data/integration/app/helpers/sub_classes_helper.rb +0 -2
- data/integration/app/models/address.rb +0 -2
- data/integration/app/models/brand.rb +0 -18
- data/integration/app/models/feature.rb +0 -13
- data/integration/app/models/foreign_brand.rb +0 -15
- data/integration/app/models/product.rb +0 -17
- data/integration/app/views/autocomplete/new.html.haml +0 -10
- data/integration/app/views/id_elements/new.html.haml +0 -12
- data/integration/app/views/layouts/application.html.haml +0 -21
- data/integration/app/views/multiple_selections/new.html.haml +0 -9
- data/integration/app/views/nested_models/new.html.haml +0 -11
- data/integration/app/views/scoped_autocompletes/new.html.haml +0 -10
- data/integration/app/views/simple_forms/new.html.haml +0 -8
- data/integration/app/views/sub_classes/new.html.haml +0 -9
- data/integration/autotest/discover.rb +0 -2
- data/integration/config.ru +0 -4
- data/integration/config/application.rb +0 -42
- data/integration/config/boot.rb +0 -13
- data/integration/config/cucumber.yml +0 -8
- data/integration/config/database.yml +0 -25
- data/integration/config/environment.rb +0 -5
- data/integration/config/environments/development.rb +0 -26
- data/integration/config/environments/production.rb +0 -49
- data/integration/config/environments/test.rb +0 -35
- data/integration/config/initializers/backtrace_silencers.rb +0 -7
- data/integration/config/initializers/inflections.rb +0 -10
- data/integration/config/initializers/mime_types.rb +0 -5
- data/integration/config/initializers/secret_token.rb +0 -7
- data/integration/config/initializers/session_store.rb +0 -8
- data/integration/config/locales/en.yml +0 -5
- data/integration/config/routes.rb +0 -90
- data/integration/db/migrate/20101209014338_create_brands.rb +0 -13
- data/integration/db/migrate/20101209014355_create_products.rb +0 -14
- data/integration/db/migrate/20101209053936_add_type_to_brand.rb +0 -9
- data/integration/db/migrate/20110209020136_create_features.rb +0 -14
- data/integration/db/migrate/20110423000347_add_state_to_brands.rb +0 -9
- data/integration/db/migrate/20110512153732_create_addresses.rb +0 -13
- data/integration/db/migrate/20110512153811_add_address_id_to_brand.rb +0 -9
- data/integration/db/schema.rb +0 -44
- data/integration/db/seeds.rb +0 -3
- data/integration/doc/README_FOR_APP +0 -2
- data/integration/features/autocomplete.feature +0 -73
- data/integration/features/step_definitions/autocomplete_steps.rb +0 -15
- data/integration/features/step_definitions/pickle_steps.rb +0 -100
- data/integration/features/step_definitions/web_steps.rb +0 -219
- data/integration/features/support/env.rb +0 -61
- data/integration/features/support/paths.rb +0 -33
- data/integration/features/support/pickle.rb +0 -24
- data/integration/lib/tasks/cucumber.rake +0 -53
- data/integration/public/404.html +0 -26
- data/integration/public/422.html +0 -26
- data/integration/public/500.html +0 -26
- data/integration/public/favicon.ico +0 -0
- data/integration/public/images/rails.png +0 -0
- data/integration/public/javascripts/application.js +0 -0
- data/integration/public/javascripts/autocomplete-rails.js +0 -16
- data/integration/public/javascripts/jquery-1.5.1.min.js +0 -17
- data/integration/public/javascripts/jquery-ui.min.js +0 -97
- data/integration/public/javascripts/jquery.min.js +0 -167
- data/integration/public/javascripts/rails.js +0 -137
- data/integration/public/robots.txt +0 -5
- data/integration/public/stylesheets/application.css +0 -61
- data/integration/public/stylesheets/jquery-ui-1.8.2.custom.css +0 -489
- data/integration/public/stylesheets/sass/application.sass +0 -66
- data/integration/script/cucumber +0 -10
- data/integration/script/rails +0 -6
- data/integration/spec/acceptance/acceptance_helper.rb +0 -15
- data/integration/spec/acceptance/autocomplete_spec.rb +0 -81
- data/integration/spec/acceptance/support/helpers.rb +0 -12
- data/integration/spec/acceptance/support/paths.rb +0 -33
- data/integration/spec/spec_helper.rb +0 -37
- data/rails3-jquery-autocomplete.gemspec +0 -31
data/integration/Rakefile
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
-
|
4
|
-
require File.expand_path('../config/application', __FILE__)
|
5
|
-
require 'rake'
|
6
|
-
|
7
|
-
Integration::Application.load_tasks
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module ErrorMessagesHelper
|
2
|
-
# Render error messages for the given objects. The :message and :header_message options are allowed.
|
3
|
-
def error_messages_for(*objects)
|
4
|
-
options = objects.extract_options!
|
5
|
-
options[:header_message] ||= "Invalid Fields"
|
6
|
-
options[:message] ||= "Correct the following errors and try again."
|
7
|
-
messages = objects.compact.map { |o| o.errors.full_messages }.flatten
|
8
|
-
unless messages.empty?
|
9
|
-
content_tag(:div, :class => "error_messages") do
|
10
|
-
list_items = messages.map { |msg| content_tag(:li, msg) }
|
11
|
-
content_tag(:h2, options[:header_message]) + content_tag(:p, options[:message]) + content_tag(:ul, list_items.join.html_safe)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
module FormBuilderAdditions
|
17
|
-
def error_messages(options = {})
|
18
|
-
@template.error_messages_for(@object, options)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
ActionView::Helpers::FormBuilder.send(:include, ErrorMessagesHelper::FormBuilderAdditions)
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# These helper methods can be called in your template to set variables to be used in the layout
|
2
|
-
# This module should be included in all views globally,
|
3
|
-
# to do so you may need to add this line to your ApplicationController
|
4
|
-
# helper :layout
|
5
|
-
module LayoutHelper
|
6
|
-
def title(page_title, show_title = true)
|
7
|
-
content_for(:title) { h(page_title.to_s) }
|
8
|
-
@show_title = show_title
|
9
|
-
end
|
10
|
-
|
11
|
-
def show_title?
|
12
|
-
@show_title
|
13
|
-
end
|
14
|
-
|
15
|
-
def stylesheet(*args)
|
16
|
-
content_for(:head) { stylesheet_link_tag(*args) }
|
17
|
-
end
|
18
|
-
|
19
|
-
def javascript(*args)
|
20
|
-
content_for(:head) { javascript_include_tag(*args) }
|
21
|
-
end
|
22
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: brands
|
4
|
-
#
|
5
|
-
# id :integer not null, primary key
|
6
|
-
# name :string(255)
|
7
|
-
# created_at :datetime
|
8
|
-
# updated_at :datetime
|
9
|
-
# type :string(255)
|
10
|
-
# state :boolean
|
11
|
-
#
|
12
|
-
|
13
|
-
class Brand < ActiveRecord::Base
|
14
|
-
scope :active, where(:state => true)
|
15
|
-
scope :with_address, joins(:address)
|
16
|
-
|
17
|
-
belongs_to :address
|
18
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: brands
|
4
|
-
#
|
5
|
-
# id :integer not null, primary key
|
6
|
-
# name :string(255)
|
7
|
-
# created_at :datetime
|
8
|
-
# updated_at :datetime
|
9
|
-
# type :string(255)
|
10
|
-
# state :boolean
|
11
|
-
#
|
12
|
-
|
13
|
-
class ForeignBrand < Brand
|
14
|
-
|
15
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: products
|
4
|
-
#
|
5
|
-
# id :integer not null, primary key
|
6
|
-
# name :string(255)
|
7
|
-
# brand_name :string(255)
|
8
|
-
# created_at :datetime
|
9
|
-
# updated_at :datetime
|
10
|
-
#
|
11
|
-
|
12
|
-
class Product < ActiveRecord::Base
|
13
|
-
attr_accessor :brand_id
|
14
|
-
|
15
|
-
has_many :features
|
16
|
-
accepts_nested_attributes_for :features
|
17
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
%h1 Id Element
|
2
|
-
|
3
|
-
= form_for @product do |form|
|
4
|
-
%p
|
5
|
-
= form.label :name
|
6
|
-
= form.text_field :name
|
7
|
-
%p
|
8
|
-
= form.label :brand_name
|
9
|
-
= form.autocomplete_field :brand_name, autocomplete_brand_name_id_elements_path, 'data-id-element' => '#product_brand_id'
|
10
|
-
%p
|
11
|
-
= form.label :brand_id
|
12
|
-
= form.text_field :brand_id
|
@@ -1,21 +0,0 @@
|
|
1
|
-
!!!
|
2
|
-
%html
|
3
|
-
|
4
|
-
%head
|
5
|
-
%title
|
6
|
-
= yield(:title) || "Untitled"
|
7
|
-
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
8
|
-
= stylesheet_link_tag "application", 'jquery-ui-1.8.2.custom'
|
9
|
-
= javascript_include_tag 'jquery-1.5.1.min.js', 'jquery-ui.min.js', 'rails', 'autocomplete-rails'
|
10
|
-
= csrf_meta_tag
|
11
|
-
= yield(:head)
|
12
|
-
|
13
|
-
%body
|
14
|
-
#container
|
15
|
-
- flash.each do |name, msg|
|
16
|
-
= content_tag :div, msg, :id => "flash_#{name}"
|
17
|
-
|
18
|
-
- if show_title?
|
19
|
-
%h1= yield(:title)
|
20
|
-
|
21
|
-
= yield
|
@@ -1,11 +0,0 @@
|
|
1
|
-
%h1 Nested Models example
|
2
|
-
= form_for @product do |form|
|
3
|
-
%p
|
4
|
-
= form.label :name
|
5
|
-
= form.text_field :name
|
6
|
-
%p
|
7
|
-
= form.fields_for :features do |feature_form|
|
8
|
-
= feature_form.label :name, "Feature Name"
|
9
|
-
= feature_form.autocomplete_field :name, autocomplete_feature_name_nested_models_path, :"data-delimiter" => ','
|
10
|
-
= feature_form.text_field :name
|
11
|
-
|
data/integration/config.ru
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
require File.expand_path('../boot', __FILE__)
|
2
|
-
|
3
|
-
require 'rails/all'
|
4
|
-
|
5
|
-
# If you have a Gemfile, require the gems listed there, including any gems
|
6
|
-
# you've limited to :test, :development, or :production.
|
7
|
-
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
|
-
|
9
|
-
module Integration
|
10
|
-
class Application < Rails::Application
|
11
|
-
# Settings in config/environments/* take precedence over those specified here.
|
12
|
-
# Application configuration should go into files in config/initializers
|
13
|
-
# -- all .rb files in that directory are automatically loaded.
|
14
|
-
|
15
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
-
|
18
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
20
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
-
|
22
|
-
# Activate observers that should always be running.
|
23
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
-
|
25
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
-
|
29
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
-
# config.i18n.default_locale = :de
|
32
|
-
|
33
|
-
# JavaScript files you want as :defaults (application.js is always included).
|
34
|
-
config.action_view.javascript_expansions[:defaults] = %w()
|
35
|
-
|
36
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
37
|
-
config.encoding = "utf-8"
|
38
|
-
|
39
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
40
|
-
config.filter_parameters += [:password]
|
41
|
-
end
|
42
|
-
end
|
data/integration/config/boot.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
|
-
# Set up gems listed in the Gemfile.
|
4
|
-
gemfile = File.expand_path('../../Gemfile', __FILE__)
|
5
|
-
begin
|
6
|
-
ENV['BUNDLE_GEMFILE'] = gemfile
|
7
|
-
require 'bundler'
|
8
|
-
Bundler.setup
|
9
|
-
rescue Bundler::GemNotFound => e
|
10
|
-
STDERR.puts e.message
|
11
|
-
STDERR.puts "Try running `bundle install`."
|
12
|
-
exit!
|
13
|
-
end if File.exist?(gemfile)
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
3
|
-
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
|
-
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
|
5
|
-
%>
|
6
|
-
default: <%= std_opts %> features
|
7
|
-
wip: --tags @wip:3 --wip features
|
8
|
-
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# SQLite version 3.x
|
2
|
-
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
3
|
-
development:
|
4
|
-
adapter: sqlite3
|
5
|
-
database: db/development.sqlite3
|
6
|
-
pool: 5
|
7
|
-
timeout: 5000
|
8
|
-
|
9
|
-
# Warning: The database defined as "test" will be erased and
|
10
|
-
# re-generated from your development database when you run "rake".
|
11
|
-
# Do not set this db to the same as development or production.
|
12
|
-
test: &test
|
13
|
-
adapter: sqlite3
|
14
|
-
database: db/test.sqlite3
|
15
|
-
pool: 5
|
16
|
-
timeout: 5000
|
17
|
-
|
18
|
-
production:
|
19
|
-
adapter: sqlite3
|
20
|
-
database: db/production.sqlite3
|
21
|
-
pool: 5
|
22
|
-
timeout: 5000
|
23
|
-
|
24
|
-
cucumber:
|
25
|
-
<<: *test
|
@@ -1,26 +0,0 @@
|
|
1
|
-
Integration::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
3
|
-
|
4
|
-
# In the development environment your application's code is reloaded on
|
5
|
-
# every request. This slows down response time but is perfect for development
|
6
|
-
# since you don't have to restart the webserver when you make code changes.
|
7
|
-
config.cache_classes = false
|
8
|
-
|
9
|
-
# Log error messages when you accidentally call methods on nil.
|
10
|
-
config.whiny_nils = true
|
11
|
-
|
12
|
-
# Show full error reports and disable caching
|
13
|
-
config.consider_all_requests_local = true
|
14
|
-
config.action_view.debug_rjs = true
|
15
|
-
config.action_controller.perform_caching = false
|
16
|
-
|
17
|
-
# Don't care if the mailer can't send
|
18
|
-
config.action_mailer.raise_delivery_errors = false
|
19
|
-
|
20
|
-
# Print deprecation notices to the Rails logger
|
21
|
-
config.active_support.deprecation = :log
|
22
|
-
|
23
|
-
# Only use best-standards-support built into browsers
|
24
|
-
config.action_dispatch.best_standards_support = :builtin
|
25
|
-
end
|
26
|
-
|