Skip to content

Commit 004c9d2

Browse files
committed
Update and rename README.rdoc to README.md
1 parent 407627f commit 004c9d2

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

README.rdoc renamed to README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
1-
active_admin_sidebar
2-
====================
1+
# ActiveAdminSidebar
32

4-
easy change sidebar position with activeadmin (tested with activeadmin ~> 1.0.0.pre)
3+
Provides ability to manipulate sidebar position with activeadmin (tested with activeadmin ~> 1.0.0.pre)
54

65

76
Add including of css file
87

8+
```scss
99
@import "active_admin_sidebar";
10+
```
1011

11-
to the app/assets/stylesheets/active_admin.css.scss
12+
to the
13+
```
14+
app/assets/stylesheets/active_admin.css.scss
15+
```
1216

1317
And including of coffee file (optional, need only for collapsed sidebar)
1418

19+
```js
1520
//= require active_admin_sidebar
21+
```
1622

17-
to the app/assets/javascripts/active_admin.js
18-
23+
to the
24+
```
25+
app/assets/javascripts/active_admin.js
26+
```
1927

2028
Changing sidebar position dynamically with before_filter
21-
29+
```ruby
2230
# app/admin/posts.rb
2331
ActiveAdmin.register Post do
2432
before_filter :left_sidebar!, only: [:show]
@@ -28,12 +36,12 @@ Changing sidebar position dynamically with before_filter
2836
ActiveAdmin.register Comment do
2937
before_filter :right_sidebar!
3038
end
31-
39+
```
3240

3341

3442
Moving sidebar to the left within all resource (config/initializers/active_admin.rb)
3543

36-
44+
```ruby
3745
# == Controller Filters
3846
#
3947
# You can add before, after and around filters to all of your
@@ -42,24 +50,22 @@ Moving sidebar to the left within all resource (config/initializers/active_admin
4250
config.before_filter do
4351
left_sidebar! if respond_to?(:left_sidebar!)
4452
end
53+
```
4554

4655
Also you can use sidebar collapsing. It will add css icon in title of first sidebar will save current state in session
47-
56+
```ruby
4857
left_sidebar!(collapsed: true)
49-
58+
```
5059
You can override button color according to your color theme:
51-
60+
```css
5261
body.active_admin {
5362
#active_admin_content.left_sidebar, #active_admin_content.collapsed_sidebar {
5463
.collapse_btn, .uncollapse_btn {
55-
cursor: pointer;
5664
background-color: #767270;
57-
border-radius: 5px;
58-
color: #ffffff;
5965
}
6066
}
6167
}
62-
68+
```
6369

6470
Example
6571

0 commit comments

Comments
 (0)