Ok, thanks for all.
Sorry if i was a bit persistent. It was my first contribution.
I hope that i could help on other tickets on rails core.
Subject closed.
On Sep 14, 1:33 pm, Jeremy Kemper wrote:
> Mateo suggests a plain Ruby shorthand since you don't like the
> obvious, concise Ruby conditi
Mateo suggests a plain Ruby shorthand since you don't like the
obvious, concise Ruby conditional. Not liking this shorthand is not
cause for some even more obscure render option.
The ticket was set to "wontfix" already. If you like the feature,
please pursue it as a plugin.
Best,
jeremy
On Mon,
Mateo Murphy i think that your code proposal is a little bit less
clear and more difficult to read.
It's for that i created a patch.
*For those who would like this to see this patch integrated to rails
could you update the lighthouse ticket with +1.*
lighthouse ticket :
https://rails.lighthous
You can already do this in one line:
>
<%= render :partial => "post", :collection => @posts or
render :partial => "no_post" %>
And soon you'll be able to do:
<%= render @posts or render 'no_post' %>
Which is about as concise as one could want!
On 12-Sep-09, at 6:12 AM, Jeremy Kemper wrote:
I liked the idea. I was just wondering if ":when_blank =>" would not fit
a bit better than ":if_blank". Not that it really changes nothing and I
would still like the :if_blank option, but just an idea...
Em 13-09-2009 12:40, Chris escreveu:
> I like the idea of being able to render a collection
I like the idea of being able to render a collection in one line and I
too find it a bit clunky to include the conditional and literal
content for the blank condition alongside the 99% case.
+1 for :if_blank
-Chris
On Sep 12, 6:15 am, rouffj wrote:
> Thanks guys for your suggestions. I Think t
Thanks guys for your suggestions. I Think that i'll adopt :if_blank
option name.
Thanks again.
Anyone has other ideas ?
On Sep 12, 4:33 am, Trek Glowacki wrote:
> :if_nil doesn't describe all cases. The collection could be not nil
> (e.g. an empty array) and you'd still want the blank slate to
On Fri, Sep 11, 2009 at 2:20 PM, rouffj wrote:
>
> Hi,
>
> Until now with Rails when we would handle empty collections in apps,
> we had to code it like that :
>
> <%# app/views/posts/index.erb %>
> <% if @posts.empty? %>
> Sorry, there is no posts yet !
> <% else %>
> <% render :partial => "po
The concept is great! Maybe go :if_blank since that's the check you
are running on it.
Adam
On Sep 11, 2009, at 8:05 PM, Jason King wrote:
>
> I like the concept, not the name. Can I suggest something like:
>
> render :partial => "post", :collection => @posts, :if_nil => "no_post"
>
> ??
>
:if_nil doesn't describe all cases. The collection could be not nil
(e.g. an empty array) and you'd still want the blank slate to show.
I'd suggest something related to blankness since it's the "blank
slate" and both [ ].blank? and nil.blank? return true.
render :partial => "post", :collection =
I like the concept, not the name. Can I suggest something like:
render :partial => "post", :collection => @posts, :if_nil => "no_post"
??
On Sep 11, 2009, at 2:20 PM, rouffj wrote:
>
> Hi,
>
> Until now with Rails when we would handle empty collections in apps,
> we had to code it like that :
11 matches
Mail list logo