upmin / upmin-admin-ruby

Framework for creating powerful admin backends with minimal effort in Ruby on Rails.
MIT License
757 stars 66 forks source link

Add a way to declare which model attributes are editable #150

Open tfe opened 9 years ago

tfe commented 9 years ago

As noted in a todo in Upmin::Attribute. Currently the editable? method just excludes common fields like ID, the timestamp attributes, etc. with a note to add a way to customize later.

jdurand commented 9 years ago

That's a good idea. Note that I just added a way to specify different fields for the create/update vs. the index views :

attributes :id, :name, :some_index_field
form_attributes :id, :name, :some_form_field

We could add something like

readonly_attribute :some_readonly_field
# or
readonly_attributes :id, :some_readonly_field, :created_at, :updated_at

I'll leave this opened for now.