Sha256: ee5473fda8f498a538ce53192aaa967e803eef9cac687b7a6c1c9bcafc142160
Contents?: true
Size: 1.52 KB
Versions: 4
Compression:
Stored size: 1.52 KB
Contents
# CustomerVault ## Install First step is to add CustomerVault to `Gemfile` : ```ruby gem "customer_vault" ``` and install it : ```bash bundle install ```` Then, you need mount it in `config/routes.rb` : ```ruby mount Dorsale::Engine, at: "/dorsale" mount CustomerVault::Engine, at: "/customer_vault" ``` CustomerVault depends on Dorsale, so you need to mount it too. After mount, you need to import and run CustomerVault (and it's dependencies) migrations : ```bash rake railties:install:migrations rake db:migrate ``` You have to perform this operation after each CustomerVault update to import eventual new migrations. You now need to import JS and CSS files in `app/assets/javascripts/application.js` : ``` //= require dorsale/all //= require customer_vault/all ``` And in `app/assets/stylesheets/application.sass` : ``` @import dorsale/all @import customer_vault/all ``` Now, CustomerVault works but is not secure. CustomerVault has a permissive `CustomerVault::Ability` class (CanCan gem) that does not control any access. You need to change the default `Ability` to use : Create this `app/controllers/customer_vault/application_controller.rb` file : ```ruby require_dependency CustomerVault::Engine.root.join("app/controllers/customer_vault/application_controller.rb") module CustomerVault class ApplicationController def current_ability @current_ability ||= ::Ability.new(current_user) end end end ``` And you just have to complete your existing `Ability.rb` using CustomerVault `Ability` as example.
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
customer_vault-1.3.2 | README.md |
customer_vault-1.3.1 | README.md |
customer_vault-1.3.0 | README.md |
customer_vault-1.2.10 | README.md |