Intro brings your rails application to new feature introduction and step-by-step users guide.
Intro injects dynamically-generated Shepherd.js code into your application whenever user should see a guided tour.
Add intro
to application's Gemfile:
gem 'intro'
And then execute:
$ bundle install
Copy migrations and configurations:
$ rails generate intro:install
Then do migrate:
$ rails db:migrate
Compile assets:
$ rails assets:precompile
Insert intro_tags
into common layout, just before the closing body tag:
<%= intro_tags %>
</body>
</html>
intro_tags
imports assets of intro and adds _intro
global variable with options.
Note: intro_tags
must be inserted into body tag for refreshing _intro
variable if you need to use Turbolinks.
Visit http://localhost:3000/intro/admin
to backstage after starting server. In config/initializers/intro.rb
file, you can get the default username and password for logining.
Then add tour and define content. After filling out the content, you need to publish tour.
If the default style doesn't satisfy you, you need to run assets generator:
$ rails generate intro:assets
Then you would get the asset files:
app/javascript/stylesheets/intro/_variables.scss
app/javascript/stylesheets/intro/custom.scss
app/javascript/packs/intro/custom.js
Change them for your need.
Last, enable custom_assets
in config/initializers/intro.rb
like this:
# config/initializers/intro.rb
# override intro tour styles
self.custom_assets = true # or 'intro/custom'
It will bring intro/custom assets into intro_tags
see config/initializers/intro.rb
for detail configuration.
Bug report or pull request are welcome.
Please write unit test with your code if necessary.
The gem is available as open source under the terms of the MIT License.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。