Flash now on failure #26

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
4 participants
@iain
Contributor

iain commented Jul 9, 2011

Since the usual pattern is that a page gets rerendered after failure, the proper behavior would be to set the flash directly, so that it doesn't stick around if you give up and leave the page.

This is a redone version of my last pull request, with some improvements.

iain added some commits Jul 9, 2011

Set default of flash_now to :on_failure
Since the usual pattern is that a page gets rerendered after failure,
the proper behavior would be to set the flash directly, so that it
doesn't stick around if you give up and leave the page.
Use a default for flash_now, enabling it to be set to false.
The previous behavior to never set flash.now can now be used again.
assert_not_flash_now should require that the flash is set
Otherwise it would return a false positive when the flash wasn't set at
all.
@nadnerb

This comment has been minimized.

Show comment
Hide comment
@nadnerb

nadnerb Oct 10, 2011

Seems to do the trick, merge please.

nadnerb commented Oct 10, 2011

Seems to do the trick, merge please.

@did

This comment has been minimized.

Show comment
Hide comment
@did

did Nov 10, 2011

I assume there has to be a reason why flash_now is not set by default to :on_failure. Am I right people from plataformatec ?

In my app, I write a custom responder and I re-define the set_flash_now? method within it like that:

    def set_flash_now?
      super || has_errors?
    end

did commented Nov 10, 2011

I assume there has to be a reason why flash_now is not set by default to :on_failure. Am I right people from plataformatec ?

In my app, I write a custom responder and I re-define the set_flash_now? method within it like that:

    def set_flash_now?
      super || has_errors?
    end
@josevalim

This comment has been minimized.

Show comment
Hide comment
@josevalim

josevalim Mar 6, 2012

Member

This pull request was good. Could you please rebase? I know I am late to the party, but for some reason it seems I was not receiving notifications. :(

Member

josevalim commented Mar 6, 2012

This pull request was good. Could you please rebase? I know I am late to the party, but for some reason it seems I was not receiving notifications. :(

@iain iain referenced this pull request Mar 6, 2012

Merged

Flash now on failure (rebase) #37

@josevalim josevalim closed this Mar 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment