Ruby on Rails
Sunday, August 18, 2013
Thanks.
-- That's what I know.
But how do I decide which to use?
On Sunday, August 18, 2013 11:09:19 PM UTC+8, Norbert Melzer wrote:
On Sunday, August 18, 2013 11:09:19 PM UTC+8, Norbert Melzer wrote:
Standard HTML:
<div>example </div>
Content_tag:
content_tag :div, "example"
Am 18.08.2013 11:19 schrieb "Brandon Brown" <whici...@gmail.com>:Is there any body who can explain the differences between using "standard HTML" and "content_tag"?--
在 2013年8月14日星期三UTC+8上午5时27分08秒,Ruby-Forum.com User写道: 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-ta...@googlegroups.com .
To post to this group, send email to rubyonra...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ .b3d28ac9-6ce9-4512-914e- 93f2a8cc567d%40googlegroups. com
For more options, visit https://groups.google.com/groups/opt_out .
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/efe20806-d001-47e6-9abb-3524a6168ccb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment