wicked 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of wicked might be problematic. Click here for more details.
- data/.travis.yml +4 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +1 -1
- data/README.md +15 -2
- data/VERSION +1 -1
- data/lib/wicked/controller/concerns/path.rb +3 -3
- data/test/dummy/config/database.yml +3 -3
- data/wicked.gemspec +6 -5
- metadata +25 -24
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Wicked
|
2
2
|
|
3
|
+
[![Build Status](https://secure.travis-ci.org/schneems/wicked.png)](http://travis-ci.org/schneems/wicked)
|
4
|
+
|
3
5
|
Use wicked to make your Rails controllers into step-by-step wizards. To see Wicked in action check out the example [Rails app](https://github.com/schneems/wicked_example) or [watch the screencast](http://schneems.com/post/18437886598/wizard-ify-your-rails-controllers-with-wicked).
|
4
6
|
|
5
7
|
## Why
|
@@ -16,6 +18,14 @@ Add this to your Gemfile
|
|
16
18
|
|
17
19
|
Then run `bundle install` and you're ready to start
|
18
20
|
|
21
|
+
## Quicklinks
|
22
|
+
|
23
|
+
* Deal with validation in a Wizard using [Partial Validation of Active Record Objects](https://github.com/schneems/wicked/wiki/Partial-Validation-of-Active-Record-Objects)
|
24
|
+
* [Show Current Wizard Progress to User](https://github.com/schneems/wicked/wiki/Show-Current-Wizard-Progress-to-User)
|
25
|
+
* [Example App](https://github.com/schneems/wicked_example)
|
26
|
+
* [Screencast](http://schneems.com/post/18437886598/wizard-ify-your-rails-controllers-with-wicked)
|
27
|
+
* [Watch Railscasts episode: #346 Wizard Forms with Wicked](http://railscasts.com/episodes/346-wizard-forms-with-wicked)
|
28
|
+
|
19
29
|
## How
|
20
30
|
|
21
31
|
We are going to build an 'after signup' wizard. First create a controller:
|
@@ -72,6 +82,8 @@ The wizard is set to call steps in order in the show action, you can specify cus
|
|
72
82
|
end
|
73
83
|
```
|
74
84
|
|
85
|
+
**Note:** Wicked uses the `:id` parameter to control the flow of steps, if you need to have an id parameter, please use nested routes see [Partial Validation of Active Record Objects](https://github.com/schneems/wicked/wiki/Partial-Validation-of-Active-Record-Objects) for an example. It will need to be prefixed, for example a Product's `:id`` would be `:product_id`
|
86
|
+
|
75
87
|
You'll need to call `render_wizard` at the end of your action to get the correct views to show up.
|
76
88
|
|
77
89
|
By default the wizard will render a view with the same name as the step. So for our controller `AfterSignupController` with a view path of `/views/after_signup/` if call the :confirm_password step, our wizard will render `/views/after_signup/confirm_password.html.erb`
|
@@ -172,6 +184,7 @@ Controller Tidbits:
|
|
172
184
|
steps :first, :second # Sets the order of steps
|
173
185
|
step # Gets symbol of current step
|
174
186
|
next_step # Gets symbol of next step
|
187
|
+
skip_step # Tells render_wizard to skip to the next logical step
|
175
188
|
render_wizard # Renders the current step
|
176
189
|
render_wizard(@user) # Shows next_step if @user.save, otherwise renders current step
|
177
190
|
```
|
@@ -180,10 +193,10 @@ Testing with RSpec
|
|
180
193
|
|
181
194
|
```ruby
|
182
195
|
# Test find_friends block of show action
|
183
|
-
get :show, :id => :find_friends
|
196
|
+
get :show, :id => :find_friends
|
184
197
|
|
185
198
|
# Test find_friends block of update action
|
186
|
-
put :update, {'id' => 'find_friends', "user" => {"id"=>@user.id.to_s}}
|
199
|
+
put :update, {'id' => 'find_friends', "user" => {"id"=>@user.id.to_s}}
|
187
200
|
|
188
201
|
```
|
189
202
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -10,18 +10,18 @@ module Wicked::Controller::Concerns::Path
|
|
10
10
|
wizard_path(@previous_step, options)
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def wicked_controller
|
14
14
|
params[:controller]
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
17
|
+
def wicked_action
|
18
18
|
params[:action]
|
19
19
|
end
|
20
20
|
|
21
21
|
|
22
22
|
def wizard_path(goto_step = nil, options = {})
|
23
23
|
options = {
|
24
|
-
:controller =>
|
24
|
+
:controller => wicked_controller,
|
25
25
|
:action => 'show',
|
26
26
|
:id => goto_step || params[:id],
|
27
27
|
:only_path => true
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# gem install sqlite3
|
3
3
|
development:
|
4
4
|
adapter: sqlite3
|
5
|
-
database:
|
5
|
+
database: ":memory:"
|
6
6
|
pool: 5
|
7
7
|
timeout: 5000
|
8
8
|
|
@@ -11,12 +11,12 @@ development:
|
|
11
11
|
# Do not set this db to the same as development or production.
|
12
12
|
test:
|
13
13
|
adapter: sqlite3
|
14
|
-
database:
|
14
|
+
database: ":memory:"
|
15
15
|
pool: 5
|
16
16
|
timeout: 5000
|
17
17
|
|
18
18
|
production:
|
19
19
|
adapter: sqlite3
|
20
|
-
database:
|
20
|
+
database: ":memory:"
|
21
21
|
pool: 5
|
22
22
|
timeout: 5000
|
data/wicked.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "wicked"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["schneems"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-05-13"
|
13
13
|
s.description = "Wicked is a Rails engine for producing easy wizard controllers"
|
14
14
|
s.email = "richard.schneeman@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
]
|
18
18
|
s.files = [
|
19
19
|
".rvmrc",
|
20
|
+
".travis.yml",
|
20
21
|
"CHANGELOG.md",
|
21
22
|
"Gemfile",
|
22
23
|
"Gemfile.lock",
|
@@ -90,8 +91,8 @@ Gem::Specification.new do |s|
|
|
90
91
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
91
92
|
s.add_runtime_dependency(%q<activesupport>, [">= 3.0.7"])
|
92
93
|
s.add_runtime_dependency(%q<rails>, [">= 3.0.7"])
|
94
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
93
95
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
94
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
95
96
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
96
97
|
s.add_development_dependency(%q<capybara>, [">= 0.4.0"])
|
97
98
|
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
@@ -99,8 +100,8 @@ Gem::Specification.new do |s|
|
|
99
100
|
else
|
100
101
|
s.add_dependency(%q<activesupport>, [">= 3.0.7"])
|
101
102
|
s.add_dependency(%q<rails>, [">= 3.0.7"])
|
103
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
102
104
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
103
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
104
105
|
s.add_dependency(%q<rcov>, [">= 0"])
|
105
106
|
s.add_dependency(%q<capybara>, [">= 0.4.0"])
|
106
107
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
@@ -109,8 +110,8 @@ Gem::Specification.new do |s|
|
|
109
110
|
else
|
110
111
|
s.add_dependency(%q<activesupport>, [">= 3.0.7"])
|
111
112
|
s.add_dependency(%q<rails>, [">= 3.0.7"])
|
113
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
112
114
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
113
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
114
115
|
s.add_dependency(%q<rcov>, [">= 0"])
|
115
116
|
s.add_dependency(%q<capybara>, [">= 0.4.0"])
|
116
117
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wicked
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-13 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70203143251220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70203143251220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &70203143250680 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,32 +32,32 @@ dependencies:
|
|
32
32
|
version: 3.0.7
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70203143250680
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement: &
|
37
|
+
name: rake
|
38
|
+
requirement: &70203143250120 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ! '>='
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
43
|
+
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70203143250120
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: &
|
48
|
+
name: jeweler
|
49
|
+
requirement: &70203143249620 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.6.4
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70203143249620
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rcov
|
60
|
-
requirement: &
|
60
|
+
requirement: &70203143249040 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70203143249040
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: capybara
|
71
|
-
requirement: &
|
71
|
+
requirement: &70203143248540 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 0.4.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70203143248540
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: sqlite3
|
82
|
-
requirement: &
|
82
|
+
requirement: &70203143248020 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70203143248020
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: launchy
|
93
|
-
requirement: &
|
93
|
+
requirement: &70203143247540 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70203143247540
|
102
102
|
description: Wicked is a Rails engine for producing easy wizard controllers
|
103
103
|
email: richard.schneeman@gmail.com
|
104
104
|
executables: []
|
@@ -107,6 +107,7 @@ extra_rdoc_files:
|
|
107
107
|
- README.md
|
108
108
|
files:
|
109
109
|
- .rvmrc
|
110
|
+
- .travis.yml
|
110
111
|
- CHANGELOG.md
|
111
112
|
- Gemfile
|
112
113
|
- Gemfile.lock
|
@@ -182,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
183
|
version: '0'
|
183
184
|
segments:
|
184
185
|
- 0
|
185
|
-
hash:
|
186
|
+
hash: -1157435944984008571
|
186
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
188
|
none: false
|
188
189
|
requirements:
|