render and redirect_to
To
render and redirect_to
To
redirect_to
redirect_to '/', alert: 'this works'
flash.alert = 'works too'
redirect_to '/'
render
to pass parameter, do
render 'new', usecase: 'register'
Then in new.html.erb, you can access params[:usecase]
and get 'register'
To flash with render
flash.alert = '...' ; render 'form'
render 'form', alert: 'Not working'
In erb, you can
<p style='color: red'><%=flash.alert %><p>
<p style='color: green'><%=alert %><p> # works too