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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey, Not quite understood – could you explain further? Thanks, /Lasse 2010/3/24 tom <tomabroad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
hi,ok let me try: i want the standard rails (error)messages like this one: 1 error prohibited this comment from being saved There were problems with the following fields: - Title can''t be blank to fade away. so not sure how to do that... thx On Thu, Mar 25, 2010 at 2:25 PM, Lasse Bunk <lassebunk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey, > > Not quite understood – could you explain further? > > Thanks, > /Lasse > > 2010/3/24 tom <tomabroad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> hi,ok let me try:
>
> i want the standard rails (error)messages like this one:
>
> 1 error prohibited this comment from being saved
>
> There were problems with the following fields:
>
> - Title can''t be blank
>
>
> to fade away.
> so not sure how to do that...
>
> thx
>
>
>
>
> On Thu, Mar 25, 2010 at 2:25 PM, Lasse Bunk
<lassebunk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> Hey,
>>
>> Not quite understood – could you explain further?
>>
>> Thanks,
>> /Lasse
>>
>> 2010/3/24 tom <tomabroad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>
>>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To unsubscribe from this group, send email to
>>>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
>>> .
>>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To unsubscribe from this group, send email to
>>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
>> .
>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
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.