casey_jones 0.0.116 → 0.0.117
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,36 +1,59 @@
|
|
1
1
|
module AjaxLoading
|
2
|
-
module
|
2
|
+
module ControllerClassMethods
|
3
3
|
def ajax_loading
|
4
4
|
class_eval do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
5
|
+
include AjaxLoading::ActionControllerExtensions
|
6
|
+
helper_method :container, :ajax_function
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
module ActionControllerExtensions
|
11
|
+
def container
|
12
|
+
@container ||= (params[:container] || choose_container)
|
13
|
+
end
|
14
|
+
def ajax_function
|
15
|
+
@ajax_function ||= (params[:ajax_function] || choose_ajax_function)
|
16
|
+
end
|
17
|
+
|
18
|
+
def choose_container
|
19
|
+
case params[:action].to_sym
|
20
|
+
when :destroy
|
21
|
+
resource.element_id
|
22
|
+
when :create
|
23
|
+
"main_container"
|
24
|
+
when :new
|
25
|
+
"main_container"
|
26
|
+
when :edit
|
27
|
+
resource.element_id
|
28
|
+
when :index
|
29
|
+
"main_container"
|
30
|
+
when :show
|
31
|
+
"main_container"
|
32
|
+
when :update
|
33
|
+
resource.element_id
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def choose_ajax_function
|
38
|
+
case params[:action].to_sym
|
39
|
+
when :destroy
|
40
|
+
"remove"
|
41
|
+
when :create
|
42
|
+
"append"
|
43
|
+
when :new
|
44
|
+
"append"
|
45
|
+
when :edit
|
46
|
+
"html"
|
47
|
+
when :show
|
48
|
+
"html"
|
49
|
+
when :index
|
50
|
+
"html"
|
51
|
+
when :update
|
52
|
+
"html"
|
30
53
|
end
|
31
54
|
end
|
32
55
|
end
|
33
56
|
end
|
34
57
|
|
35
|
-
ActionController::Base.extend AjaxLoading::
|
58
|
+
ActionController::Base.extend AjaxLoading::ControllerClassMethods
|
36
59
|
|
data/lib/casey_jones.rb
CHANGED
@@ -3,6 +3,7 @@ require 'casey_jones/application_helper_methods'
|
|
3
3
|
require 'casey_jones/string_reader'
|
4
4
|
require 'ajax_loading/ajax_loading'
|
5
5
|
require 'acts_as_linkable/acts_as_linkable'
|
6
|
+
require 'casey_jones/casey_jones_engine'
|
6
7
|
ActiveRecord::Base.extend(CaseyJones::ActiveRecord)
|
7
8
|
ActionView::Base.send :include, CaseyJones::ApplicationHelperMethods
|
8
9
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: casey_jones
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 245
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 117
|
10
|
+
version: 0.0.117
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tyler Gannon
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-17 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/casey_jones.rb
|
43
43
|
- lib/casey_jones/active_record_extensions.rb
|
44
44
|
- lib/casey_jones/application_helper_methods.rb
|
45
|
+
- lib/casey_jones/casey_jones_engine.rb
|
45
46
|
- lib/casey_jones/string_reader.rb
|
46
47
|
- lib/generators/anaf_habtm/anaf_habtm_generator.rb
|
47
48
|
- lib/generators/anaf_habtm/assets/nested_attributes.css
|