#503 ✓resolved
Iain

(Not Available) options disappear after failed validation

Reported by Iain | October 16th, 2009 @ 05:54 AM

Given a form with a drop-down menu for an associated model (say on the new page), the "(Not Available)" menu option appears before submitting the form, but if the form is submitted and fails validation then when it is reloaded the "(Not Available)" options are no longer there.

I have only just noticed this and I can't be sure if it's Rapid, DRYML or even rails that's the cause of it but it's a pretty annoying flaw - basically you can only set that association to nil on the first attempt at the form

I'm using hobo 0.8.10 and rails 2.3.4. It should be easy to reproduce as I haven't done anything particularly interesting with the form that I've noticed it on

Comments and changes to this ticket

  • Bryan Larsen

    Bryan Larsen October 16th, 2009 @ 06:34 PM

    • State changed from “new” to “investigating”
    • Tag changed from defect, dryml, validation to defect, rapid

    Have you set the "include-none" option on your form?

    If my memory serves me correctly, "include-none" is set to false by default. However, on your initial form, the current value is nil, so the select-one adds a "Not Available".

  • Bryan Larsen

    Bryan Larsen October 20th, 2009 @ 04:18 PM

    Oh I think I understand you're bug report. You're saying that:

    If you submit a form with the item set to "Not Available", if it fails validation the form is displayed set to some other value because "Not Available" is no longer in the drop down?

    Yes, I would consider that a valid bug.

  • Bryan Larsen

    Bryan Larsen October 20th, 2009 @ 04:45 PM

    • Tag changed from defect, rapid to defect, documentation, rapid
    • State changed from “investigating” to “resolved”

    The behaviour isn't quite how I described: If you submit the form with the item set, you no longer get "Not Available" as an option on the redisplay. If you submit it without the item set, "Not Available" is an option.

    I agree that the user may consider this surprising behaviour (and surprises are bad). However, I can't really think of an easy fix. I recommend explicitly setting include-none as appropriate to get non-surprising behaviour.

    I updated the documentation to make this behaviour more clear. Please reopen if you think I should try harder to fix this bug.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages