spring15wad / rollingread

RollingRead - Project 2 & 3 for Web Application Development COM531 at Illinois Tech
0 stars 1 forks source link

assignments should belongs_to: courses, not sources #7

Closed mfreema5 closed 9 years ago

mfreema5 commented 9 years ago

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.