You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/activeadmin/nested/namespaces`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
-
TODO: Delete this and the text above, and describe your gem
3
+
This plugin allows you to register resources/pages with nested namespaces in ActiveAdmin.
Copy and paste these lines to `config/initializers/active_admin_nested_namespace.rb`
22
19
23
-
## Usage
20
+
```ruby
21
+
require'active_admin/nested_namespace'
24
22
25
-
TODO: Write usage instructions here
23
+
ifdefined?(ActiveAdmin::NestedNamespace)
24
+
ActiveAdmin::NestedNamespace.setup
25
+
end
26
+
```
26
27
27
-
## Development
28
28
29
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
29
+
# Get Started
30
30
31
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
31
+
Register resources to 2 different namespaces:
32
32
33
-
## Contributing
33
+
```ruby
34
+
# /app/admin/site1/foo/bar/posts.rb
35
+
ActiveAdmin.register Post, namespace: [:admin, :site1, :foo, :bar] do
36
+
...
37
+
end
38
+
```
34
39
35
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activeadmin-nested-namespaces. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
40
+
```ruby
41
+
# /app/admin/site2/demo/posts.rb
42
+
ActiveAdmin.register Post, namespace: [:admin, :site2, :demo] do
43
+
...
44
+
end
45
+
```
36
46
37
-
## License
47
+
It will generate routes like:
38
48
39
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
49
+
```
50
+
admin_site1_foo_bar_root GET /admin/site1/foo/bar(.:format) admin/site1/foo/bar/dashboard#index
51
+
admin_site2_demo_root GET /admin/site2/demo(.:format)
52
+
batch_action_admin_site1_foo_bar_posts POST /admin/site1/foo/bar/posts/batch_action(.:format) admin/site1/foo/bar/posts#batch_action
53
+
admin_site1_foo_bar_posts GET /admin/site1/foo/bar/posts(.:format) admin/site1/foo/bar/posts#index
54
+
POST /admin/site1/foo/bar/posts(.:format) admin/site1/foo/bar/posts#create
55
+
new_admin_site1_foo_bar_post GET /admin/site1/foo/bar/posts/new(.:format) admin/site1/foo/bar/posts#new
56
+
edit_admin_site1_foo_bar_post GET /admin/site1/foo/bar/posts/:id/edit(.:format) admin/site1/foo/bar/posts#edit
57
+
admin_site1_foo_bar_post GET /admin/site1/foo/bar/posts/:id(.:format) admin/site1/foo/bar/posts#show
Everyone interacting in the Activeadmin::Nested::Namespaces project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/activeadmin-nested-namespaces/blob/master/CODE_OF_CONDUCT.md).
0 commit comments