abraham 0.1.1 → 1.0.0
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 +4 -4
- data/README.md +17 -6
- data/app/controllers/abraham_histories_controller.rb +1 -1
- data/app/helpers/abraham_helper.rb +2 -1
- data/lib/abraham/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b75864d476b103f987bcfebba3192a4b3c646970
|
4
|
+
data.tar.gz: 60b54906c18bc75b0afe2fb5131fd31bd6a9fd39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56d6c9a0fd49be1354d182a083ea29504051092bd362303d32b2bb47f9cbadef71abc3e5e0d33999a2346533d2a01854bac07bd08a095ffa8d566273c9c96416
|
7
|
+
data.tar.gz: 17abb8e5732b9f48c67459fdfeb3b99a1acbcc483a9240ae78af7c1d4c3d7592c90385c2a0bf1f2cedd066b45ef12ce21899cd6cfc61f6f4bc9b96f4636fa89b
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Abraham injects dynamically-generated [Shepherd.js](http://github.hubspot.com/sh
|
|
12
12
|
|
13
13
|
## Requirements
|
14
14
|
|
15
|
-
|
15
|
+
Abraham needs to know the current user to track tour views, e.g. `current_user` from Devise.
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
|
@@ -51,6 +51,21 @@ Shepherd.js provides the following themes:
|
|
51
51
|
- `shepherd-theme-square`
|
52
52
|
- `shepherd-theme-square-dark`
|
53
53
|
|
54
|
+
Update `config/abraham.yml` if you choose a different theme:
|
55
|
+
|
56
|
+
```
|
57
|
+
defaults: &defaults
|
58
|
+
:default_theme: 'shepherd-theme-arrows'
|
59
|
+
```
|
60
|
+
|
61
|
+
Tell Abraham where to insert its generated JavaScript in `app/views/layouts/application.html.erb`, just before the closing `body` tag:
|
62
|
+
|
63
|
+
```erb
|
64
|
+
<%= abraham_tour %>
|
65
|
+
</body>
|
66
|
+
</html>
|
67
|
+
```
|
68
|
+
|
54
69
|
## Defining your tours
|
55
70
|
|
56
71
|
Define your tours in the `config/tours` directory. Its directory structure should mirror your application's controllers, and the tour files should mirror your actions/views.
|
@@ -101,8 +116,4 @@ Abraham takes care of which buttons should appear with each step:
|
|
101
116
|
|
102
117
|
### Testing your tours
|
103
118
|
|
104
|
-
Abraham loads tour definitions once when you start your server.
|
105
|
-
|
106
|
-
```
|
107
|
-
???
|
108
|
-
```
|
119
|
+
Abraham loads tour definitions once when you start your server. Restart your server to see tour changes.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
class AbrahamHistoriesController < ApplicationController
|
3
3
|
def create
|
4
4
|
@abraham_history = AbrahamHistory.new(abraham_history_params)
|
5
|
-
@abraham_history.creator_id = current_user
|
5
|
+
@abraham_history.creator_id = current_user.id
|
6
6
|
respond_to do |format|
|
7
7
|
if @abraham_history.save
|
8
8
|
format.json { render json: @abraham_history, status: :created }
|
@@ -11,7 +11,8 @@ module AbrahamHelper
|
|
11
11
|
|
12
12
|
if tours
|
13
13
|
completed = AbrahamHistory.where(
|
14
|
-
creator_id: current_user,
|
14
|
+
creator_id: current_user.id,
|
15
|
+
controller_name: controller_name,
|
15
16
|
action_name: action_name
|
16
17
|
)
|
17
18
|
remaining = tours.keys - completed.map(&:tour_name)
|
data/lib/abraham/version.rb
CHANGED