# Flash message == if statement over-riding?

**URL:** <https://www.ruby-forum.com/t/flash-message-if-statement-over-riding/103195>\
**Category:** Rails\
**Created:** [May 2, 2007, 9:00pm UTC](https://www.ruby-forum.com/t/flash-message-if-statement-over-riding/103195 "2007-05-02T21:00:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ByENNEN](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/35a633/32.png) [@ByENNEN](https://www.ruby-forum.com/u/ByENNEN)\
**Post date:** [May 2, 2007, 9:00pm UTC](https://www.ruby-forum.com/t/flash-message-if-statement-over-riding/103195/1 "2007-05-02T21:00:07Z")

</div>

Here is the code I need help with:

[http://pastie.caboo.se/58307](http://pastie.caboo.se/58307)

My problem is I have a custom save message throughout my app. My  
client needs the message to be different for one save in the app. If  
you click on the pastie you will see in the code where I’m having  
problems. I know this is probably something stupid… but I am new to  
this. Thanks for any help you guys can provide!

---

<div class="post-metadata">

**Author:** ![ByENNEN](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/35a633/32.png) [@ByENNEN](https://www.ruby-forum.com/u/ByENNEN)\
**Post date:** [May 2, 2007, 9:07pm UTC](https://www.ruby-forum.com/t/flash-message-if-statement-over-riding/103195/2 "2007-05-02T21:07:08Z")

</div>

this is a comment from a different user group:

How do you know the first if statement is skipped? The next one  
overwrites the flash messages in all cases so it doesn’t matter what  
you did in the first block.

how would i redo the code??
