Open pstoica opened 10 years ago
Note: PSA submissions should have the status 'new' which can only be changed on the admin side; so hide this for the end user.
@nlts if you're looking for a starter/refresher issue, this one is pretty straightforward.
UP FOR GRABS
Staff members should be able to submit PSAs for approval, since DJs are often part of other student orgs that would have good material.
We often use a natural language parser called Chronic for dates, abstracted as a mixable concern). This module could use some documentation, but it's already implemented in the PSA model:
You use it by calling
natural_language_date_attr
on the field, and it will create a setter named:expiration_date_string
which takes a string, parses it into a date, and passes it back to the:expiration_date
field. The mixin also creates an_is_date
validator, but you have to add the validation yourself.The PSA admin form shows how to use all this in a form:
So, make a controller (
app/controllers/staff/psas_controller.rb
) withnew
andcreate
actions (maybeindex
if you want to show pending PSAs?), the appropriate views in (app/views/staff/*.html.slim
), and the routes inroutes.rb
.