Hello RoR Developers,
I was wondering that can we send warning message like “alert” from
controller.
can I write something like
flash[:message]=“message”
alert(<%flash[:message]%>)
warn.message(“or something like this”).
thanks…
Hello RoR Developers,
I was wondering that can we send warning message like “alert” from
controller.
can I write something like
flash[:message]=“message”
alert(<%flash[:message]%>)
warn.message(“or something like this”).
thanks…
<%= flash[:error] %>
this alone will do…
no need for warn or alert…
alert will not work…
In controller under respond to assign value to flash[:notice] like
flash[:notice] = ‘Successfully created.’
and in views get that displayed as <%= flash[:notice] %>
Ratnavel S. wrote:
<%= flash[:error] %>
this alone will do…
no need for warn or alert…alert will not work…
In controller under respond to assign value to flash[:notice] like
flash[:notice] = ‘Successfully created.’and in views get that displayed as <%= flash[:notice] %>
Ok. I will try again. Last time I couldn t use it. Anyway I will write
if I have problem with it.
thank you very much…
Ok. I will try again. Last time I couldn t use it. Anyway I will write
if I have problem with it.thank you very much…
K all the best…
K all the best…
hmmm Ratnavel S.
I think I make mistake but when I try
flash[:notice] = ‘Successfully created.’
<%= flash[:notice] %>
it s written like normal line. do you know another way to do it. sending
warning message to user from controller.
actually I have another question about it. while I have two controllers
(report and sheet(view page)) how can I call this warning message from
other controller.
I mean view page belong to sheet controller, I want to send this error
message from report controller.
thanks again and again…
u need sheet controllers error message to be displayed in view page of
report controller
you got misunderstanding, report controller has no view page, all
controllers use one,
some of methods are kept in report controller,anyway you don t need all
information,
Basically, my problem is that can not send warning message even from
sheet controller(view page controller).
pop up windows or another way I don t know how to send message without
refreshing page… I know but couldnt.
flash[:notice] = ‘Successfully created.’
<%= flash[:notice] %>
Message will be active in the flash[:notice] until it is implicitely
made nil.
I never tried doing it…
Anyway,
Yr question is this rite…
u have flash[:notice] in both yr sheet controller and report
controller…
u need sheet controllers error message to be displayed in view page of
report controller
how about flash,
flash[:error]=“error message”
<%=flash[:error]%>
I tried it but written like normal line. is it suitable for this
situation,
and another question if we assume that the page can be refreshed, how
can we send message like alert in javascript.
thanks Mikel,
On Thu, Mar 6, 2008 at 6:04 PM, Lamer L.
[email protected] wrote:
Basically, my problem is that can not send warning message even from
sheet controller(view page controller).
pop up windows or another way I don t know how to send message without
refreshing page… I know but couldnt.
You can’t send it without refreshing the page unless your site uses
AJAX or some basic Javascript.
One way is have a periodic call to your server, if something comes
back, display it.
You’ll have to research that out a bit.
Regards
Mikel
Alain R.
Thank you very much
Nice,
Thanks - Tonypm
I was wondering that can we send warning message like “alert” from
controller.
In the controller :
flash[:alert] = "a message to the user ..."
In the layout (or view) :
…
<% if flash[:alert] %>
<% end -%>
I use this trick to make
redirect_to … , :anchor => ‘error’
work with IE :
In the controller :
flash[:scroll_to_for_ie] = ‘an_error’
redirect_to url_for( …, :anchor =>‘an_error’)
In the layout :
…
<% if flash[:scroll_to_for_ie] %>
<% end -%>
Alain
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs