Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6879881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:54:10+00:00 2026-05-27T04:54:10+00:00

There are many posts on SO about this ( respond_with redirect with notice flash

  • 0

There are many posts on SO about this ( respond_with redirect with notice flash message not working Why is :notice not showing after redirect in Rails 3, among others) , I’ve read at least 4 and still can’t solve this issue.

I’ve got a portion of my site that lets people do some things before they create an account. I prefer this from a UX perspective. So they’re allowed to do X and Y then they get redirected to the “Create account” page (uses Devise).

The redirect looks like:

if userIsNew 
  ... stow information in a cookie to be retrieved later ...     
  redirect_to "/flash", flash[:notice]  
    => "Ok, we'll get right on that after you sign up (we need your email)." 
      and return # this has to be here, since I'm terminating the action early
end 

So "/flash" is a plain page that I made to test this. It doesn’t do anything, has no markup of its own, just has the basic html from the application.html, which has this line in the body:

 <% if flash[:notice] %>
    <p><%= notice %></p>
 <% else %>
  No notice!
 <% end %>

It says ‘No notice’ every time.

I have tried:

  • adding in a flash.keep to my before_filter in the static controller
  • using :notice => instead of flash[:notice] =>
  • putting the notice in a cookie and pulling that text out of the cookie and into a flash in the before_filter of my application controller
  • redirect_to :back with the flash[:notice] =>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:54:11+00:00Added an answer on May 27, 2026 at 4:54 am

    It’s either

    flash[:notice] = 'blablabla'
    redirect_to foo_url
    

    or

    redirect_to foo_url, notice: 'blablabla'

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that there are many posts about this on Stackoverflow, but this one
There are a few posts about this, but after hours of searching I still
I did not want to post this question since there are so many posts
I know there are many posts about this issue however I cannot find one
There was a post this morning asking about how many people disable JavaScript. Then
There are a couple of posts about this on Stack Overflow but none with
I have read many posts and blogs about rewriting and I know there is
I've read many posts and blogs at this point and I'm still not sure
There are many posts about Devise and the lack of availability of current_user for
I've read many posts about reloading the Activity. I understand it is not the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.