Skip to content

Commit

Permalink
Merge pull request #66 from stewart/fix/add-credentials-to-readme
Browse files Browse the repository at this point in the history
Flesh out installation instructions
  • Loading branch information
stewart authored Jul 13, 2016
2 parents 5cbfb5b + add07f9 commit a736fcf
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,37 @@ Installation
------------

Just add this line to your `Gemfile`:

```ruby
gem "solidus_auth_devise"
```

Then run `bundle install`.
Then, run `bundle install`.

After that's done, you can install and run the necessary migrations, then seed the database:

```shell
bundle exec rake solidus_auth:install:migration
bundle exec rake db:migrate
bundle exec rake db:seed
```

### Default Username/Password

As part of running the above installation steps, you will be asked to set an admin email/password combination. The default values are `admin@example.com` and `test123`, respectively.

### Confirmable

To enable Devise's Confirmable module, which will send the user an email with a link to confirm their account, you must do the following:

* Add this line to an initializer in your Rails project (typically `config/initializers/spree.rb`):

```ruby
Spree::Auth::Config[:confirmable] = true
```

* Add a Devise initializer to your Rails project (typically `config/initializers/devise.rb`):

```ruby
Devise.setup do |config|
# Required so users don't lose their carts when they need to confirm.
Expand Down Expand Up @@ -57,11 +72,13 @@ end
```

Then register your class in your spree initializer: config/initializers/spree.rb

```ruby
Spree::Ability.register_ability(SuperAbilities)
```

Inside of your host application you can then use CanCan like you normally would.

```erb
<% if can? :stop Bullet %>
...
Expand Down

0 comments on commit a736fcf

Please sign in to comment.