Ruby on Rails Tuesday, August 13, 2013

kanna wrote in post #1118570:
> Hi
>
> i tried content_tag inside content_tag bu its not working
>
> <%= content_tag(:h1,"Arrange"+content_tag(:span,"Demo"))%>
>
> i want like this type
>
> <h1>Arrange <span>Demo</span></h1>
>
>
>More readably (IMO):
>
> <%= content_tag :h1 do %>
> Arrange <%= content_tag :span, 'Demo' %>
> <% end %>

What's wrong with just using standard HTML:

<h1>Arrange <span>Demo</span></h1>

Not sure how a bunch of nested content_tag() are 'more readable' than
that.

Personally i hate the content_tag method. It just obfuscates your DOM.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a4281ea275f17d674b48c94267db2660%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment