glow 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -3
- data/.travis.yml +15 -0
- data/Gemfile +18 -0
- data/README.md +1 -7
- data/Rakefile +9 -12
- data/glow.gemspec +1 -1
- data/lib/glow/version.rb +1 -1
- data/{test/rails3/spec → spec}/controllers/flash_controller_spec.rb +5 -1
- data/{test/rails3 → spec/dummy}/.rspec +0 -0
- data/{test/rails3 → spec/dummy}/Gemfile +0 -0
- data/{test/rails3 → spec/dummy}/Rakefile +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/{test/rails3/public → spec/dummy/app/assets}/javascripts/glow.js +0 -0
- data/{test/rails3/public → spec/dummy/app/assets}/javascripts/jquery.js +0 -0
- data/{test/rails3/public → spec/dummy/app/assets}/javascripts/jquery_ujs.js +0 -0
- data/{test/rails3 → spec/dummy}/app/controllers/application_controller.rb +0 -0
- data/{test/rails3 → spec/dummy}/app/controllers/flash_controller.rb +0 -0
- data/{test/rails3 → spec/dummy}/app/views/flash/ajax.js.erb +0 -0
- data/{test/rails3 → spec/dummy}/app/views/flash/show.html.erb +0 -0
- data/{test/rails3 → spec/dummy}/app/views/layouts/application.html.erb +5 -1
- data/{test/rails3 → spec/dummy}/config.ru +0 -0
- data/{test/rails3 → spec/dummy}/config/application.rb +4 -1
- data/{test/rails3 → spec/dummy}/config/boot.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/environment.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/environments/development.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/environments/production.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/environments/test.rb +5 -3
- data/{test/rails3 → spec/dummy}/config/initializers/backtrace_silencers.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/initializers/inflections.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/initializers/mime_types.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/initializers/secret_token.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/initializers/session_store.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/initializers/wrap_parameters.rb +0 -0
- data/{test/rails3 → spec/dummy}/config/locales/en.yml +0 -0
- data/{test/rails3 → spec/dummy}/config/routes.rb +1 -1
- data/{test/rails3 → spec/dummy}/log/.gitkeep +0 -0
- data/{test/rails3 → spec/dummy}/public/404.html +0 -0
- data/{test/rails3 → spec/dummy}/public/422.html +0 -0
- data/{test/rails3 → spec/dummy}/public/500.html +0 -0
- data/{test/rails3 → spec/dummy}/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/glow.js +35 -0
- data/spec/dummy/public/javascripts/jquery.js +8981 -0
- data/{test/rails3 → spec/dummy}/public/javascripts/jquery.min.js +0 -0
- data/spec/dummy/public/javascripts/jquery_ujs.js +331 -0
- data/{test/rails3 → spec/dummy}/script/rails +0 -0
- data/{test/rails3/spec/integration → spec/features}/flash_spec.rb +0 -0
- data/{test/rails3/spec → spec}/spec_helper.rb +1 -1
- metadata +102 -276
- data/Gemfile.lock +0 -96
- data/test/rails3/Gemfile.lock +0 -133
- data/test/rails3/spec/controllers/.flash_controller_spec.rb.swn +0 -0
- data/test/rails3/spec/controllers/.flash_controller_spec.rb.swo +0 -0
- data/test/rails31/.gitignore +0 -5
- data/test/rails31/Gemfile +0 -34
- data/test/rails31/Gemfile.lock +0 -166
- data/test/rails31/Rakefile +0 -7
- data/test/rails31/app/assets/images/rails.png +0 -0
- data/test/rails31/app/assets/javascripts/application.js +0 -10
- data/test/rails31/app/assets/stylesheets/application.css +0 -7
- data/test/rails31/app/controllers/application_controller.rb +0 -3
- data/test/rails31/app/controllers/flash_controller.rb +0 -25
- data/test/rails31/app/views/flash/ajax.js.erb +0 -1
- data/test/rails31/app/views/flash/show.html.erb +0 -13
- data/test/rails31/app/views/layouts/application.html.erb +0 -14
- data/test/rails31/config.ru +0 -4
- data/test/rails31/config/application.rb +0 -51
- data/test/rails31/config/boot.rb +0 -6
- data/test/rails31/config/environment.rb +0 -5
- data/test/rails31/config/environments/development.rb +0 -30
- data/test/rails31/config/environments/production.rb +0 -60
- data/test/rails31/config/environments/test.rb +0 -42
- data/test/rails31/config/initializers/backtrace_silencers.rb +0 -7
- data/test/rails31/config/initializers/inflections.rb +0 -10
- data/test/rails31/config/initializers/mime_types.rb +0 -5
- data/test/rails31/config/initializers/secret_token.rb +0 -7
- data/test/rails31/config/initializers/session_store.rb +0 -8
- data/test/rails31/config/initializers/wrap_parameters.rb +0 -10
- data/test/rails31/config/locales/en.yml +0 -5
- data/test/rails31/config/routes.rb +0 -6
- data/test/rails31/log/.gitkeep +0 -0
- data/test/rails31/public/404.html +0 -26
- data/test/rails31/public/422.html +0 -26
- data/test/rails31/public/500.html +0 -26
- data/test/rails31/public/favicon.ico +0 -0
- data/test/rails31/public/robots.txt +0 -5
- data/test/rails31/script/rails +0 -6
- data/test/rails31/spec/controllers/.flash_controller_spec.rb.swn +0 -0
- data/test/rails31/spec/controllers/.flash_controller_spec.rb.swo +0 -0
- data/test/rails31/spec/controllers/flash_controller_spec.rb +0 -55
- data/test/rails31/spec/integration/flash_spec.rb +0 -22
- data/test/rails31/spec/spec_helper.rb +0 -31
- data/test/rails32/.gitignore +0 -5
- data/test/rails32/Gemfile +0 -34
- data/test/rails32/Gemfile.lock +0 -161
- data/test/rails32/Rakefile +0 -7
- data/test/rails32/app/assets/images/rails.png +0 -0
- data/test/rails32/app/assets/javascripts/application.js +0 -10
- data/test/rails32/app/assets/stylesheets/application.css +0 -7
- data/test/rails32/app/controllers/application_controller.rb +0 -3
- data/test/rails32/app/controllers/flash_controller.rb +0 -25
- data/test/rails32/app/views/flash/ajax.js.erb +0 -1
- data/test/rails32/app/views/flash/show.html.erb +0 -13
- data/test/rails32/app/views/layouts/application.html.erb +0 -14
- data/test/rails32/config.ru +0 -4
- data/test/rails32/config/application.rb +0 -51
- data/test/rails32/config/boot.rb +0 -6
- data/test/rails32/config/environment.rb +0 -5
- data/test/rails32/config/environments/development.rb +0 -30
- data/test/rails32/config/environments/production.rb +0 -60
- data/test/rails32/config/environments/test.rb +0 -42
- data/test/rails32/config/initializers/backtrace_silencers.rb +0 -7
- data/test/rails32/config/initializers/inflections.rb +0 -10
- data/test/rails32/config/initializers/mime_types.rb +0 -5
- data/test/rails32/config/initializers/secret_token.rb +0 -7
- data/test/rails32/config/initializers/session_store.rb +0 -8
- data/test/rails32/config/initializers/wrap_parameters.rb +0 -10
- data/test/rails32/config/locales/en.yml +0 -5
- data/test/rails32/config/routes.rb +0 -6
- data/test/rails32/log/.gitkeep +0 -0
- data/test/rails32/public/404.html +0 -26
- data/test/rails32/public/422.html +0 -26
- data/test/rails32/public/500.html +0 -26
- data/test/rails32/public/favicon.ico +0 -0
- data/test/rails32/public/robots.txt +0 -5
- data/test/rails32/script/rails +0 -6
- data/test/rails32/spec/controllers/.flash_controller_spec.rb.swn +0 -0
- data/test/rails32/spec/controllers/.flash_controller_spec.rb.swo +0 -0
- data/test/rails32/spec/controllers/flash_controller_spec.rb +0 -55
- data/test/rails32/spec/integration/flash_spec.rb +0 -22
- data/test/rails32/spec/spec_helper.rb +0 -31
File without changes
|
data/test/rails31/script/rails
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|
Binary file
|
Binary file
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'htmlentities'
|
4
|
-
|
5
|
-
ActionDispatch::Flash::FlashHash.class_eval do
|
6
|
-
def discard?(key); @used.include?(key); end
|
7
|
-
def keep?(key); !discard?(key); end
|
8
|
-
end
|
9
|
-
|
10
|
-
describe FlashController do
|
11
|
-
it "should display flash message on redirect" do
|
12
|
-
post :redirect, type: :notice, message: 'Glow!'
|
13
|
-
|
14
|
-
flash[:notice].should be == 'Glow!'
|
15
|
-
flash.keep?(:notice).should be true
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should display flash message on xhr" do
|
19
|
-
xhr :get, :ajax, type: :notice, message: 'Glow!'
|
20
|
-
|
21
|
-
flash[:notice].should be == 'Glow!'
|
22
|
-
flash.discard?(:notice).should be true
|
23
|
-
|
24
|
-
@response.headers['X-Message-Type'].should be == 'notice'
|
25
|
-
HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'Glow!'
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should handle unicode on xhr" do
|
29
|
-
xhr :get, :ajax, type: :notice, message: 'utf8: ✓'
|
30
|
-
@response.headers['X-Message-Type'].should be == 'notice'
|
31
|
-
HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'utf8: ✓'
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should not display flash message on xhr when skip_glow is set" do
|
35
|
-
xhr :get, :ajax, type: :notice, message: 'utf8: ✓', skip_glow: true
|
36
|
-
@response.headers.should_not have_key 'X-Message-Type'
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should pass flash message on JSON requests" do
|
40
|
-
get :ajax, type: :notice, message: 'Glow!', format: :json
|
41
|
-
|
42
|
-
flash[:notice].should be == 'Glow!'
|
43
|
-
flash.discard?(:notice).should be true
|
44
|
-
|
45
|
-
@response.headers['X-Message-Type'].should be == 'notice'
|
46
|
-
HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'Glow!'
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should not pass flash message on XML requests" do
|
50
|
-
get :ajax, type: :notice, message: 'Glow!', format: :xml
|
51
|
-
|
52
|
-
@response.headers['X-Message-Type'].should be_nil
|
53
|
-
@response.headers['X-Message'].should be_nil
|
54
|
-
end
|
55
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe "the flash view" do
|
5
|
-
it "redirects" do
|
6
|
-
visit root_path
|
7
|
-
click_on 'redirect'
|
8
|
-
page.should have_content('utf8: ✓')
|
9
|
-
end
|
10
|
-
|
11
|
-
it "handles rails ajax" do
|
12
|
-
visit root_path
|
13
|
-
click_on 'rails ajax'
|
14
|
-
page.should have_content('rails ajax: ✓')
|
15
|
-
end
|
16
|
-
|
17
|
-
it "handles jquery ajax" do
|
18
|
-
visit root_path
|
19
|
-
click_on 'jquery ajax'
|
20
|
-
page.should have_content('jquery ajax: ✓')
|
21
|
-
end
|
22
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV["RAILS_ENV"] ||= 'test'
|
3
|
-
require File.expand_path("../../config/environment", __FILE__)
|
4
|
-
require 'rspec/rails'
|
5
|
-
require 'capybara/rspec'
|
6
|
-
require 'capybara/rails'
|
7
|
-
|
8
|
-
Capybara.default_driver = :webkit
|
9
|
-
|
10
|
-
# Requires supporting ruby files with custom matchers and macros, etc,
|
11
|
-
# in spec/support/ and its subdirectories.
|
12
|
-
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
13
|
-
|
14
|
-
RSpec.configure do |config|
|
15
|
-
# == Mock Framework
|
16
|
-
#
|
17
|
-
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
18
|
-
#
|
19
|
-
# config.mock_with :mocha
|
20
|
-
# config.mock_with :flexmock
|
21
|
-
# config.mock_with :rr
|
22
|
-
config.mock_with :rspec
|
23
|
-
|
24
|
-
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
25
|
-
#config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
26
|
-
|
27
|
-
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
28
|
-
# examples within a transaction, remove the following line or assign false
|
29
|
-
# instead of true.
|
30
|
-
#config.use_transactional_fixtures = true
|
31
|
-
end
|
data/test/rails32/.gitignore
DELETED
data/test/rails32/Gemfile
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
source 'http://rubygems.org'
|
2
|
-
|
3
|
-
gem 'rails', '~> 3.2.0'
|
4
|
-
|
5
|
-
# Bundle edge Rails instead:
|
6
|
-
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# Gems used only for assets and not required
|
11
|
-
# in production environments by default.
|
12
|
-
group :assets do
|
13
|
-
gem 'sass-rails', " ~> 3.2.0"
|
14
|
-
gem 'coffee-rails', "~> 3.2.0"
|
15
|
-
gem 'uglifier'
|
16
|
-
end
|
17
|
-
|
18
|
-
gem 'glow', path: '../..'
|
19
|
-
|
20
|
-
gem 'jquery-rails'
|
21
|
-
gem 'rspec-rails'
|
22
|
-
gem 'capybara'
|
23
|
-
gem 'htmlentities'
|
24
|
-
gem 'capybara-webkit'
|
25
|
-
|
26
|
-
# Use unicorn as the web server
|
27
|
-
# gem 'unicorn'
|
28
|
-
|
29
|
-
# Deploy with Capistrano
|
30
|
-
# gem 'capistrano'
|
31
|
-
|
32
|
-
# To use debugger
|
33
|
-
# gem 'ruby-debug19', :require => 'ruby-debug'
|
34
|
-
|
data/test/rails32/Gemfile.lock
DELETED
@@ -1,161 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ../..
|
3
|
-
specs:
|
4
|
-
glow (0.0.13)
|
5
|
-
jquery-rails
|
6
|
-
rails (>= 3.0.0, < 4.0.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
actionmailer (3.2.8)
|
12
|
-
actionpack (= 3.2.8)
|
13
|
-
mail (~> 2.4.4)
|
14
|
-
actionpack (3.2.8)
|
15
|
-
activemodel (= 3.2.8)
|
16
|
-
activesupport (= 3.2.8)
|
17
|
-
builder (~> 3.0.0)
|
18
|
-
erubis (~> 2.7.0)
|
19
|
-
journey (~> 1.0.4)
|
20
|
-
rack (~> 1.4.0)
|
21
|
-
rack-cache (~> 1.2)
|
22
|
-
rack-test (~> 0.6.1)
|
23
|
-
sprockets (~> 2.1.3)
|
24
|
-
activemodel (3.2.8)
|
25
|
-
activesupport (= 3.2.8)
|
26
|
-
builder (~> 3.0.0)
|
27
|
-
activerecord (3.2.8)
|
28
|
-
activemodel (= 3.2.8)
|
29
|
-
activesupport (= 3.2.8)
|
30
|
-
arel (~> 3.0.2)
|
31
|
-
tzinfo (~> 0.3.29)
|
32
|
-
activeresource (3.2.8)
|
33
|
-
activemodel (= 3.2.8)
|
34
|
-
activesupport (= 3.2.8)
|
35
|
-
activesupport (3.2.8)
|
36
|
-
i18n (~> 0.6)
|
37
|
-
multi_json (~> 1.0)
|
38
|
-
addressable (2.3.2)
|
39
|
-
arel (3.0.2)
|
40
|
-
builder (3.0.0)
|
41
|
-
capybara (1.1.2)
|
42
|
-
mime-types (>= 1.16)
|
43
|
-
nokogiri (>= 1.3.3)
|
44
|
-
rack (>= 1.0.0)
|
45
|
-
rack-test (>= 0.5.4)
|
46
|
-
selenium-webdriver (~> 2.0)
|
47
|
-
xpath (~> 0.1.4)
|
48
|
-
capybara-webkit (0.12.1)
|
49
|
-
capybara (>= 1.0.0, < 1.2)
|
50
|
-
json
|
51
|
-
childprocess (0.3.5)
|
52
|
-
ffi (~> 1.0, >= 1.0.6)
|
53
|
-
coffee-rails (3.2.2)
|
54
|
-
coffee-script (>= 2.2.0)
|
55
|
-
railties (~> 3.2.0)
|
56
|
-
coffee-script (2.2.0)
|
57
|
-
coffee-script-source
|
58
|
-
execjs
|
59
|
-
coffee-script-source (1.3.3)
|
60
|
-
diff-lcs (1.1.3)
|
61
|
-
erubis (2.7.0)
|
62
|
-
execjs (1.4.0)
|
63
|
-
multi_json (~> 1.0)
|
64
|
-
ffi (1.1.5)
|
65
|
-
hike (1.2.1)
|
66
|
-
htmlentities (4.3.1)
|
67
|
-
i18n (0.6.0)
|
68
|
-
journey (1.0.4)
|
69
|
-
jquery-rails (2.0.2)
|
70
|
-
railties (>= 3.2.0, < 5.0)
|
71
|
-
thor (~> 0.14)
|
72
|
-
json (1.7.4)
|
73
|
-
libwebsocket (0.1.5)
|
74
|
-
addressable
|
75
|
-
mail (2.4.4)
|
76
|
-
i18n (>= 0.4.0)
|
77
|
-
mime-types (~> 1.16)
|
78
|
-
treetop (~> 1.4.8)
|
79
|
-
mime-types (1.19)
|
80
|
-
multi_json (1.3.6)
|
81
|
-
nokogiri (1.5.5)
|
82
|
-
polyglot (0.3.3)
|
83
|
-
rack (1.4.1)
|
84
|
-
rack-cache (1.2)
|
85
|
-
rack (>= 0.4)
|
86
|
-
rack-ssl (1.3.2)
|
87
|
-
rack
|
88
|
-
rack-test (0.6.1)
|
89
|
-
rack (>= 1.0)
|
90
|
-
rails (3.2.8)
|
91
|
-
actionmailer (= 3.2.8)
|
92
|
-
actionpack (= 3.2.8)
|
93
|
-
activerecord (= 3.2.8)
|
94
|
-
activeresource (= 3.2.8)
|
95
|
-
activesupport (= 3.2.8)
|
96
|
-
bundler (~> 1.0)
|
97
|
-
railties (= 3.2.8)
|
98
|
-
railties (3.2.8)
|
99
|
-
actionpack (= 3.2.8)
|
100
|
-
activesupport (= 3.2.8)
|
101
|
-
rack-ssl (~> 1.3.2)
|
102
|
-
rake (>= 0.8.7)
|
103
|
-
rdoc (~> 3.4)
|
104
|
-
thor (>= 0.14.6, < 2.0)
|
105
|
-
rake (0.9.2.2)
|
106
|
-
rdoc (3.12)
|
107
|
-
json (~> 1.4)
|
108
|
-
rspec (2.11.0)
|
109
|
-
rspec-core (~> 2.11.0)
|
110
|
-
rspec-expectations (~> 2.11.0)
|
111
|
-
rspec-mocks (~> 2.11.0)
|
112
|
-
rspec-core (2.11.1)
|
113
|
-
rspec-expectations (2.11.2)
|
114
|
-
diff-lcs (~> 1.1.3)
|
115
|
-
rspec-mocks (2.11.2)
|
116
|
-
rspec-rails (2.11.0)
|
117
|
-
actionpack (>= 3.0)
|
118
|
-
activesupport (>= 3.0)
|
119
|
-
railties (>= 3.0)
|
120
|
-
rspec (~> 2.11.0)
|
121
|
-
rubyzip (0.9.9)
|
122
|
-
sass (3.2.0)
|
123
|
-
sass-rails (3.2.5)
|
124
|
-
railties (~> 3.2.0)
|
125
|
-
sass (>= 3.1.10)
|
126
|
-
tilt (~> 1.3)
|
127
|
-
selenium-webdriver (2.25.0)
|
128
|
-
childprocess (>= 0.2.5)
|
129
|
-
libwebsocket (~> 0.1.3)
|
130
|
-
multi_json (~> 1.0)
|
131
|
-
rubyzip
|
132
|
-
sprockets (2.1.3)
|
133
|
-
hike (~> 1.2)
|
134
|
-
rack (~> 1.0)
|
135
|
-
tilt (~> 1.1, != 1.3.0)
|
136
|
-
thor (0.16.0)
|
137
|
-
tilt (1.3.3)
|
138
|
-
treetop (1.4.10)
|
139
|
-
polyglot
|
140
|
-
polyglot (>= 0.3.1)
|
141
|
-
tzinfo (0.3.33)
|
142
|
-
uglifier (1.2.7)
|
143
|
-
execjs (>= 0.3.0)
|
144
|
-
multi_json (~> 1.3)
|
145
|
-
xpath (0.1.4)
|
146
|
-
nokogiri (~> 1.3)
|
147
|
-
|
148
|
-
PLATFORMS
|
149
|
-
ruby
|
150
|
-
|
151
|
-
DEPENDENCIES
|
152
|
-
capybara
|
153
|
-
capybara-webkit
|
154
|
-
coffee-rails (~> 3.2.0)
|
155
|
-
glow!
|
156
|
-
htmlentities
|
157
|
-
jquery-rails
|
158
|
-
rails (~> 3.2.0)
|
159
|
-
rspec-rails
|
160
|
-
sass-rails (~> 3.2.0)
|
161
|
-
uglifier
|
data/test/rails32/Rakefile
DELETED
@@ -1,7 +0,0 @@
|
|
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
|
-
Rails31::Application.load_tasks
|
Binary file
|
@@ -1,10 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
-
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
-
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
-
// the compiled file.
|
6
|
-
//
|
7
|
-
//= require jquery
|
8
|
-
//= require jquery_ujs
|
9
|
-
//= require glow
|
10
|
-
//= require_tree .
|
@@ -1,7 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
-
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
-
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
-
*= require_self
|
6
|
-
*= require_tree .
|
7
|
-
*/
|
@@ -1,25 +0,0 @@
|
|
1
|
-
class FlashController < ApplicationController
|
2
|
-
|
3
|
-
headerize_flash_for :json
|
4
|
-
|
5
|
-
def show
|
6
|
-
# show.html.erb
|
7
|
-
end
|
8
|
-
|
9
|
-
def redirect
|
10
|
-
flash[params[:type].to_sym] = params[:message]
|
11
|
-
redirect_to action: 'show'
|
12
|
-
end
|
13
|
-
|
14
|
-
def ajax
|
15
|
-
respond_to do |wants|
|
16
|
-
[:js, :json, :xml].each do |fmt|
|
17
|
-
wants.send(fmt) {
|
18
|
-
flash[params[:type].to_sym] = params[:message]
|
19
|
-
flash[:skip_glow] = params[:skip_glow].present?
|
20
|
-
head :ok
|
21
|
-
}
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
console.log('ajax response');
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<script type="application/javascript">
|
2
|
-
// Flash handling
|
3
|
-
$(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').text(flash.message); });
|
4
|
-
</script>
|
5
|
-
|
6
|
-
<p id="flash"><%= flash.map { |type, message| message }.join %></p>
|
7
|
-
<p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓' %></p>
|
8
|
-
<p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓'}, remote: true %></p>
|
9
|
-
<p><%= link_to 'jquery ajax', '#', id: 'ajax' %></p>
|
10
|
-
|
11
|
-
<script type="application/javascript">
|
12
|
-
$('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery ajax: ✓', format: :js %>'); return false;});
|
13
|
-
</script>
|
data/test/rails32/config.ru
DELETED