effective_resources 1.8.30 → 1.8.31
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: 2cac8ab4956bad6e580c5edfe77d2040d13430b327acff13874f0d447e2cb154
|
4
|
+
data.tar.gz: 9d2aeb097b2a71715aec44af86b49628549c0083ecd757f742047ae17842207b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c04ecb8170f56016f354a93dd1be925ac08cef0f9dc77b93027457fa30b3382907943083877f47daa6dc000e700be9594a69e52a69fe63a0846a1d988413876c
|
7
|
+
data.tar.gz: 73e362b25cc6acbc6c9abf0c8e8c87ad1a9b19d4a2d4c4e5f0a21cdc9f4071e8084ec15685fcb29a8d96bd1d9241c36f4d2569c79244247c3df8cd77eca2c333
|
data/README.md
CHANGED
@@ -352,6 +352,8 @@ Here's `views/things/start.html.haml`:
|
|
352
352
|
|
353
353
|
You can also call `render_wizard_sidebar(resource)` without the block syntax.
|
354
354
|
|
355
|
+
If you add `f.hidden_field(:skip_to_step, value: 'stepc')` you can control the next step.
|
356
|
+
|
355
357
|
## Testing
|
356
358
|
|
357
359
|
Run tests by:
|
@@ -9,7 +9,7 @@ module Effective
|
|
9
9
|
if save_resource(resource, action)
|
10
10
|
flash[:success] ||= options.delete(:success) || resource_flash(:success, resource, action)
|
11
11
|
|
12
|
-
@skip_to ||= resource
|
12
|
+
@skip_to ||= skip_to_step(resource)
|
13
13
|
@redirect_to ||= resource_wizard_path(resource, @skip_to) if was_new_record
|
14
14
|
|
15
15
|
redirect_to(@redirect_to || wizard_path(@skip_to))
|
@@ -19,6 +19,14 @@ module Effective
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
private
|
23
|
+
|
24
|
+
def skip_to_step(resource)
|
25
|
+
resource.skip_to_step ||
|
26
|
+
resource.required_steps.find { |s| s == next_step } ||
|
27
|
+
resource.first_uncompleted_step
|
28
|
+
end
|
29
|
+
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|