Assignments should belong to courses, not sources.
If assignments belong to courses, you can easily create sources on the fly.
Make a boolean column source.many_assignments; when true, that source becomes an auto-populating option when making assignments. Otherwise, the string (text?) entered along with the assignment triggers creation of a new source with source.many_assignments == 'false'.
For URLs, just run source.short_source.match('^http[s]*://')[0].nil?. If false, do link_to( source.short_source.match('[^/].+$',6)[0], source.short_source ) on it.
Assignments should belong to
courses
, notsources
.If
assignments
belong tocourses
, you can easily createsources
on the fly.Make a boolean column
source.many_assignments
; whentrue
, that source becomes an auto-populating option when makingassignments
. Otherwise, the string (text?) entered along with the assignment triggers creation of a newsource
withsource.many_assignments == 'false'
.For URLs, just run
source.short_source.match('^http[s]*://')[0].nil?
. If false, dolink_to( source.short_source.match('[^/].+$',6)[0], source.short_source )
on it.