subactions 1.0.1
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 +7 -0
- data/lib/subactions.rb +14 -0
- metadata +65 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b1c5155fd8589e6c23c7c3823d7eef5ae0f7fe1a
|
4
|
+
data.tar.gz: 41c47926d77f88d2ec43c3be8432e288c613585b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3b715af9e30af45128639560557d2016c3079754985b456c1e2190aaa3746e6e5402ea9b73876320a6a50cd0e40b6155505c547ad623f65cdea2c488d68403f7
|
7
|
+
data.tar.gz: a79aed5c3050795881c90d1f8ae34de0b3c787c672303f2ab54e56b63d6bcac6542acd9608f779732b51c643c348d305b8c4f3a58927c7685e50a436b2b107c9
|
data/lib/subactions.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module Subactions
|
2
|
+
ActionController::Base.class_eval do
|
3
|
+
def subaction(method, options={default: false})
|
4
|
+
unless @subaction_used
|
5
|
+
if params[:subaction] == method.to_s || (options[:default] == true && !params[:subaction])
|
6
|
+
if options[:render] == true
|
7
|
+
@subaction_used = true
|
8
|
+
end
|
9
|
+
return self.send(method)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: subactions
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben Titcomb
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.0.0
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.0
|
33
|
+
description: Simplifies making slight variations on controller actions in Ruby on
|
34
|
+
Rails web apps.
|
35
|
+
email: benjamin@pixelstreetinc.com
|
36
|
+
executables: []
|
37
|
+
extensions: []
|
38
|
+
extra_rdoc_files: []
|
39
|
+
files:
|
40
|
+
- lib/subactions.rb
|
41
|
+
homepage: http://github.com/Ravenstine/subactions
|
42
|
+
licenses:
|
43
|
+
- MIT
|
44
|
+
metadata: {}
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubyforge_project:
|
61
|
+
rubygems_version: 2.2.2
|
62
|
+
signing_key:
|
63
|
+
specification_version: 4
|
64
|
+
summary: Subactions
|
65
|
+
test_files: []
|