administration-zero 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 214d49406cab89939a1eed9fca062ea1eddec241da295ced816f779ee2f6d439
|
4
|
+
data.tar.gz: 4fba566d3efca4b047eb189207ba69a8bd00d4224b4b34aff56db44bcbf0c04a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b88ec66ddfd35b0e1fb14225f7788a1d3c8bcfee529329490400b914664d02be2ace9d27042662793c810e414079d66615d09558a02b0605a2f8b497cc16ff9f
|
7
|
+
data.tar.gz: fb350fef6c38587bf81ec922e8a258ad37a4044c2d159d3efd12f5a8235ec9959f60b61c9e0c41baa24c715ce34c6d8d04e8eb181423c8d5de754aa1c0554250
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,13 +21,24 @@ gem "authentication-zero"
|
|
21
21
|
|
22
22
|
Then run `bundle install`
|
23
23
|
|
24
|
+
You'll need to create a model to be administrated, if you don't have one. for this example let's use the following:
|
25
|
+
|
26
|
+
```
|
27
|
+
$ rails generate model posts title:string body:text published:boolean
|
28
|
+
```
|
29
|
+
|
24
30
|
## Usage
|
25
31
|
|
26
32
|
```
|
27
33
|
$ rails generate admin:install
|
28
34
|
```
|
29
35
|
|
30
|
-
Then run `bundle install` again
|
36
|
+
Then run `bundle install` again
|
37
|
+
|
38
|
+
Then run `rails db:seed`, you can access the admin panel in `/admin`, using `email: "admin@example.com", password: "Password9957"`
|
39
|
+
|
40
|
+
|
41
|
+
Now you're ready to generate your admin scaffolds.
|
31
42
|
|
32
43
|
```
|
33
44
|
$ rails generate admin:scaffold posts title:string body:text published:boolean
|
@@ -14,7 +14,8 @@ module Admin
|
|
14
14
|
gem "spreadsheet_architect", comment: "Spreadsheet Architect is a library that allows you to create XLSX, ODS, or CSV spreadsheets super easily [https://github.com/westonganger/spreadsheet_architect]"
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
17
|
+
def create_db_files
|
18
|
+
copy_file "db/seeds.rb", "db/seeds.rb", force: true
|
18
19
|
migration_template "migrations/create_admin_users.rb", "#{db_migrate_path}/create_admin_users.rb"
|
19
20
|
end
|
20
21
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
|
7
|
+
# Character.create(name: "Luke", movie: movies.first)
|
8
|
+
|
9
|
+
AdminUser.create(email: "admin@example.com", password: "Password9957", password_confirmation: "Password9957")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administration-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nixon
|
@@ -457,6 +457,7 @@ files:
|
|
457
457
|
- lib/generators/admin/install/templates/models/admin/current.rb
|
458
458
|
- lib/generators/admin/install/templates/models/admin_user.rb
|
459
459
|
- lib/generators/admin/install/templates/models/application_record.rb
|
460
|
+
- lib/generators/admin/install/templates/seeds.rb
|
460
461
|
- lib/generators/admin/install/templates/test_unit/admin_users.yml
|
461
462
|
- lib/generators/admin/install/templates/test_unit/application_system_test_case.rb
|
462
463
|
- lib/generators/admin/install/templates/test_unit/controllers/admin/home_controller_test.rb
|