# Flash notice

**URL:** <https://www.ruby-forum.com/t/flash-notice/136269>\
**Category:** Rails\
**Created:** [April 30, 2008, 9:13am UTC](https://www.ruby-forum.com/t/flash-notice/136269 "2008-04-30T09:13:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://www.ruby-forum.com/u/joel)\
**Post date:** [April 30, 2008, 9:13am UTC](https://www.ruby-forum.com/t/flash-notice/136269/1 "2008-04-30T09:13:08Z")

</div>

Hello,

I’m using this piece of code to allow users to register to my site :

```
 def create
   cookies.delete :auth_token
   @user = User.new(params[:user])
   @user.save!
   #Uncomment to have the user logged in after creating an account

```

- Not Recommended  
#self.current\_user = @user  
flash[:notice] = “Thanks for signing up! Please check your email  
to activate your account before logging in.”  
redirect\_to :controller=\>‘sessions’, :action=\>‘new’  
rescue ActiveRecord::RecordInvalid  
flash[:error] = “There was a problem creating your account.”  
render :action =\> ‘new’  
end

The code works pretty well, except for the flash notice message that  
I’m not seeing ! User account information is well inserted in the  
database.

Can someone help ? May be its due to the layout i’m using currently ?

Please let me know.

Regards,

Joel

---

<div class="post-metadata">

**Author:** ![joel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://www.ruby-forum.com/u/joel)\
**Post date:** [April 30, 2008, 9:18am UTC](https://www.ruby-forum.com/t/flash-notice/136269/2 "2008-04-30T09:18:27Z")

</div>

I have this in my layout:

\<%= flash[:notice] %\>

I would check to see, as if I delete this I don't get a flash either.

---

<div class="post-metadata">

**Author:** ![joel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://www.ruby-forum.com/u/joel)\
**Post date:** [April 30, 2008, 9:30am UTC](https://www.ruby-forum.com/t/flash-notice/136269/3 "2008-04-30T09:30:56Z")

</div>

Ok,

thank you for your reply but I can’t add a html tag in the controller.  
This isn’t working unfortunately.  
Having an " unexpected ‘\<’ " error.

Regards,

Joel

---

<div class="post-metadata">

**Author:** ![joel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@joel](https://www.ruby-forum.com/u/joel)\
**Post date:** [April 30, 2008, 9:36am UTC](https://www.ruby-forum.com/t/flash-notice/136269/4 "2008-04-30T09:36:19Z")

</div>

Ok got it !

Have to implement it on the redirected view. Sorry 😉

Regards,

Joel
