charlottebrf / DoctorsWhoCode

My Time Manager: Your helpful time manager app created for CF: G Ruby course AW 2016 course competition project.
https://evening-lowlands-39707.herokuapp.com/
0 stars 0 forks source link

Stop user from entering the exact same target twice #41

Open melikecode opened 7 years ago

melikecode commented 7 years ago

Current behaviour: If user enters the exact same target twice, it will show twice. If the user deletes any of the identical targets, all identical targets will be deleted from the list

melikecode commented 7 years ago

The regexp code for pattern="[^,]+" title="Invalid input" isn't compatible with Safari, so I've added code in the .rb file to cleanse any dodgy entries that come through.

melikecode commented 7 years ago

For practical purposes this works. Worst case, if they enter it twice, they can delete and re-add the target so it shows only once. Our app shows them what targets are already set, so this mitigates.

charlottebrf commented 7 years ago

@ajh146 is this closed or open?

melikecode commented 7 years ago

Technically we haven't really stopped him from doing this, so it can stay open because it would be great to stop them from entering the same thing twice. If we move to a database then that may make this a moot issue, because we can probably more easily stop them from entering something twice because it will be easier. To determine using code whether theyve tried to .