In my user controller/model I'm creating a user. When I redirect to user
format.html { redirect_to(@user, :notice => 'You have successfully registered!') }
I get a nice notice displayed on my page
When I try to redirect to a different controller without an object
format.html { redirect_to(:controller => 'profiles', :action => 'index', :notice => 'You have successfully registered!') }
I get the notice on the url and not displayed on my page.
profile?notice=You+have+successfully+registered%21
is there any way to put the notice into some object and display it on my page?
format.html {
flash[:notice] = 'You have successfully registered!'
redirect_to(:controller => 'profiles', :action => 'index')
}
or try this
format.html { redirect_to(:controller => 'profiles', :action => 'index'), :notice => 'You have successfully registered!' }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With