You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
Staff members should be able to submit PSAs for approval, since DJs are often part of other student orgs that would have good material.
Create a "PSA Suggestions" page in the Staff section of the site.
Staff should be able to add a title, body, and expiration date.
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:
class Psa < ActiveRecord::Base
include NaturalLanguageDate
natural_language_date_attr :expiration_date
validate :expiration_date_string_is_date
end
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.
So, make a controller (app/controllers/staff/psas_controller.rb) with new and create actions (maybe index if you want to show pending PSAs?), the appropriate views in (app/views/staff/*.html.slim), and the routes in routes.rb.
The text was updated successfully, but these errors were encountered:
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
.The text was updated successfully, but these errors were encountered: