upmin / upmin-admin-ruby

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

Edit date fields #114

Closed elsom25 closed 9 years ago

elsom25 commented 10 years ago

Have a model defined as:

# Table name: projects
#
#  created_at :datetime
#  ends_at    :date
#  id         :integer          not null, primary key
#  name       :string(255)
#  starts_at  :date
#  updated_at :datetime

and the starts_at and ends_at fields are not editable. There is only one validation added to the model, which is one that guarantees ends_at is after starts_at, and nothing else on the model.

I trued making an AdminProject model as outlined, and even added custom setter methods to it, all without any luck.

Help?

joncalhoun commented 10 years ago

Currently the partials are only there for date time. You should be able to reuse that code but it would take some custom work. I would welcome a PR with the updates tho :)

On Fri, Nov 7, 2014, 4:03 PM Jesse McGinnis notifications@github.com wrote:

Have a model defined as:

Table name: projects## created_at :datetime# ends_at :date# id :integer not null, primary key# name :string(255)# starts_at :date# updated_at :datetime

and the starts_at and ends_at fields are not editable. There is only one validation added to the model, which is one that guarantees ends_at is after starts_at, and nothing else on the model.

I trued making an AdminProject model as outlined, and even added custom setter methods to it, all without any luck.

Help?

— Reply to this email directly or view it on GitHub https://github.com/upmin/upmin-admin-ruby/issues/114.