rao-service_controller 0.0.34.pre → 0.0.35.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b16db751f11c940c44896837ac073cd3dd5cfa59aa99089a3c92f6bdc0c75a1c
|
4
|
+
data.tar.gz: 4291a1ebbc4bc1e11a62ae1c1e22aa50ca1b0997d32949ccd47fe1f6fb5a2688
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9ddbf9fbfd2f71f64094a3093eea1cf9eaa32b3cd4a319bf58e03d387b939d233ba604bd08698f15eefe439bda12b40b3ebd7d73e635223c7a1ad281f52e638
|
7
|
+
data.tar.gz: 8bc7cfb3f6046a1d542623d927d7568a3c650da025a2de569ba1839d3b008d9879d6a0ceb393b58872a6fa1f450e3540d7cd80a2ffd943a41a7328003afb7192
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Rao
|
2
|
+
# Handles automatic form submits.
|
3
|
+
#
|
4
|
+
# Prerequisites:
|
5
|
+
#
|
6
|
+
# Include the javascript:
|
7
|
+
#
|
8
|
+
# # app/assets/javascripts/application.js
|
9
|
+
# //= require rao/service_controller/application/autosubmit
|
10
|
+
#
|
11
|
+
# Example:
|
12
|
+
#
|
13
|
+
# # app/controllers/posts_controller.rb
|
14
|
+
# class PostsController < ApplicationController
|
15
|
+
# include Rao::ServiceController::AutosubmitConcern
|
16
|
+
#
|
17
|
+
# # ...
|
18
|
+
#
|
19
|
+
# private
|
20
|
+
#
|
21
|
+
# def autosubmit?
|
22
|
+
# true
|
23
|
+
# end
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# # app/views/posts/new.html.haml
|
27
|
+
# = form_for(...) do |f|
|
28
|
+
# = f.input :autosubmit, as: :autosubmit
|
29
|
+
#
|
30
|
+
module ServiceController::AutosubmitConcern
|
31
|
+
extend ActiveSupport::Concern
|
32
|
+
|
33
|
+
included do
|
34
|
+
helper_method :autosubmit?, :autosubmit_now?
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def autosubmit?
|
40
|
+
false
|
41
|
+
end
|
42
|
+
|
43
|
+
def autosubmit_now?
|
44
|
+
autosubmit? && action_name == 'new'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rao-service_controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.35.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -146,16 +146,18 @@ files:
|
|
146
146
|
- MIT-LICENSE
|
147
147
|
- README.md
|
148
148
|
- Rakefile
|
149
|
-
- app/assets/javascripts/rao/service_controller/application/
|
149
|
+
- app/assets/javascripts/rao/service_controller/application/autosubmit.js
|
150
150
|
- app/assets/stylesheets/rao-service_controller.css
|
151
151
|
- app/assets/stylesheets/rao/service_controller/application.css
|
152
152
|
- app/assets/stylesheets/rao/service_controller/application/table_monospaced.css
|
153
|
+
- app/concerns/rao/service_controller/autosubmit_concern.rb
|
153
154
|
- app/concerns/rao/service_controller/location_history_concern.rb
|
154
155
|
- app/concerns/rao/service_controller/rest_actions_concern.rb
|
155
156
|
- app/concerns/rao/service_controller/rest_service_urls_concern.rb
|
156
157
|
- app/concerns/rao/service_controller/service_concern.rb
|
157
158
|
- app/concerns/rao/service_controller/service_inflections_concern.rb
|
158
159
|
- app/controllers/rao/service_controller/base.rb
|
160
|
+
- app/inputs/autosubmit_input.rb
|
159
161
|
- app/views/rao/service_controller/base/_create_after_service_output.haml
|
160
162
|
- app/views/rao/service_controller/base/_create_before_service_output.haml
|
161
163
|
- app/views/rao/service_controller/base/_form_buttons.haml
|