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> plz help. bye -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/22daf30c-3405-4d70-9e88-eb893877a132%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
call like this content_tag(:h1,raw("Arrange"+(content_tag(:span,"Demo")))) => "<h1>Arrange<span>Demo</span></h1>" kingston.s On Tuesday, August 13, 2013 5:20:18 PM UTC+5:30, kanna wrote:> > 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> > > plz help. > > bye >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/44e34ea8-752a-4cad-b506-cc8b6591aa7a%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
On Tue, Aug 13, 2013 at 4:50 AM, kanna <vtrkanna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i tried content_tag inside content_tag bu its not workingMore readably (IMO): <%= content_tag :h1 do %> Arrange <%= content_tag :span, ''Demo'' %> <% end %> -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBcoSJ427fmM6HgknQkcQaTRJ0H_CUDC7QEdYiKJxKq9A%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
hi I tried <%= content_tag(:h1,"Arrange".html_safe + content_tag(:span," Demo"))%> its coming fine. thanks for everyone . * Follow me on Twitter <https://twitter.com/vtrkanna> * *Follow me on LinkedIn <http://www.linkedin.com/in/vtrkanna> * *Follow me on Facebook <https://www.facebook.com/kannavrk> * * kanna(9742665400)*........... On Wed, Aug 14, 2013 at 2:57 AM, masta Blasta <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPtiWRDNE8PR79e-5V%2BsbbYJX%2BQ8o9qfbSOTA8_s5u%2BvW414WA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Standard HTML: <div>example </div> Content_tag: content_tag :div, "example" Am 18.08.2013 11:19 schrieb "Brandon Brown" <whicily1988-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVsuG3dQyPk0vwW%3DP06o88274cA41NPzAMD-kPN9%3DC_C%2BVQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
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:> > Standard HTML: > > <div>example </div> > > Content_tag: > > content_tag :div, "example" > Am 18.08.2013 11:19 schrieb "Brandon Brown" <whici...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<javascript:> > >: > >> 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...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. >> To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:> >> . >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Norbert Melzer wrote in post #1119014:> Standard HTML: > > <div>example </div> > > Content_tag: > > content_tag :div, "example" > Am 18.08.2013 11:19 schrieb "Brandon Brown" <whicily1988-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > Thanks. > > That''s what I know. > > But how do I decide which to use?The most (and i''d say only) useful aspect of content_tag is the ability to iterate over a collection: <%= content_tag_for(:tr, @people) do |person| %> <td><%= person.first_name %></td> <td><%= person.last_name %></td> <% end %> which produces items with a predictable id and class. <tr id="person_123" class="person">...</tr> <tr id="person_124" class="person">...</tr> see doc: http://api.rubyonrails.org/classes/ActionView/Helpers/RecordTagHelper.html#method-i-content_tag_for But in most cases where you just need standard tags, you should plain ol'' html because it''s much easier to maintain. <h1><%= @person.name %></h1> is better than <%= content_tag :h1, @person.name %> -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/244d33e7dcb8f1cd687c3eb08c0f9431%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.