Ok – you could easily do this by fading the div with id="errorExplanation", like this:
$('errorExplanation').fade();
Would this do it?
/Lasse
2010/3/25 tom <tomabroad@gmail.com>
hi,ok let me try:
i want the standard rails (error)messages like this one:to fade away.1 error prohibited this comment from being saved
There were problems with the following fields:
- Title can't be blank
so not sure how to do that...
thxOn Thu, Mar 25, 2010 at 2:25 PM, Lasse Bunk <lassebunk@gmail.com> wrote:
Hey,
Not quite understood – could you explain further?
Thanks,
/Lasse
2010/3/24 tom <tomabroad@gmail.com>
--this is my current code:
#notice {
border: solid 1px #99cc99;
background-color: #e2f9e3;
color: #006600;
padding: 5px;
margin-bottom: 5px;
}
#notice.error {
border-color: #e2f9e3;
background-color: #eeaaaa;
color: #cc0000;
}
<% flash.each do |key, msg| %>
<%= content_tag :div, flash[:error] || flash[:notice], :id => 'notice', :class => ('error' if flash[:error]) %>
<% content_tag :script, :type => "text/javascript" do %>
$('<%= key %>').style.display = 'none';
new Effect.Appear('<%= key %>', {duration: 3});
<% end %>
<% content_tag :script, :type => "text/javascript" do %>
setTimeout("new Effect.Fade('<%= key %>');", 10000);
<% end %>
<% end %>
but how can i achieve to css the rails standard way of showing errors liek that one:1 error prohibited this comment from being saved
There were problems with the following fields:
- Title can't be blank
only if i return something like that:
flash[:error] = 'Error'
it actually shows up in "my" div.
hope u guys know what i mean ;-)
thx
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment