≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1616

Bug #1616: Problem with models with editable permalinks (validation and form resubmission)

Kind bug
Product wincent.dev
When Created 2010-07-20T07:17:35Z, updated 2010-07-23T12:23:19Z
Status closed
Reporter Greg Hurrell
Tags no tags

Description

This problem affects all models with editable permalinks, such as:

  • users (display name)
  • articles (title)
  • blog posts (permalink)

And so on.

The problem occurs when:

  1. edit permalink
  2. make some other change which fails validation
  3. edit form is re-rendered, but post URL is not going to work, because it points at a different record

Comments

  1. Greg Hurrell 2010-07-20T15:03:08Z

    Looks like it can be handled fairly cleanly with changes to the to_param method; for example:

    def to_param
      if (display_name_changes = changes['display_name']) &&
        !display_name_changes.first.nil?
        User.parametrize display_name_changes.first
      else
        User.parametrize display_name
      end
    end
  2. Greg Hurrell 2010-07-20T19:09:56Z

    Ok, so that's the user case handled. Must also handle the other cases mentioned above.

    Possibly also:

    • links (permalink)
    • emails (address)
    • forums (permalink)
    • pages (permalink)
    • products (permalink)
    • tags (name)
  3. Greg Hurrell 2010-07-23T12:22:54Z

    Ok, pretty sure I've handled all of these cases now. Marking as closed.

  4. Greg Hurrell 2010-07-23T12:23:19Z

    Status changed:

    • From: new
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets