We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f29bfd commit efed854Copy full SHA for efed854
README.md
@@ -73,6 +73,23 @@ rails g madmin:views:index
73
# -> app/views/madmin/application/index.html.erb
74
```
75
76
+You might want to make some of your model's attributes visible in some views but invisible in others.
77
+The `attribute` method in model_resource.rb gives you that flexibility.
78
+
79
+```bash
80
+ # -> app/madmin/resources/book_resource.rb
81
+```
82
+```ruby
83
+class UserResource < Madmin::Resource
84
+ attribute :id, form: false
85
+ attribute :tile
86
+ attribute :subtitle, index: false
87
+ attribute :author
88
+ attribute :genre
89
+ attribute :pages, show: false
90
+end
91
92
93
You can also scope the copied view(s) to a specific Resource/Model:
94
```bash
95
rails generate madmin:views:index Book
0 commit comments