Commander Johnson
2011-Aug-29 16:02 UTC
[haml] simple question that would make my life a lot better
Hello, In HAML, is it possible to get this result: - link_to "http://www.example.com" do - "www" - "example" - "com" => "wwwexamplecom" So far I''ve only managed to get: => "com" Which is logical because of the way Ruby blocks work. But, it defeats the HAML purpose of concatenating the things you put underneath each other. CmdJohnson -- http://rubyonrailsdeveloper.nl -- 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.
Jeffrey L. Taylor
2011-Aug-29 16:12 UTC
Re: [haml] simple question that would make my life a lot better
Quoting Commander Johnson <commanderjohnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Hello, > > In HAML, is it possible to get this result: > > - link_to "http://www.example.com" do > - "www" > - "example" > - "com" >What about: - link_to "http://www.example.com" do - ["www", "example", "com"] Jeffrey -- 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.
Jim Ruther Nill
2011-Aug-29 16:17 UTC
Re: [haml] simple question that would make my life a lot better
On Tue, Aug 30, 2011 at 12:02 AM, Commander Johnson < commanderjohnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > In HAML, is it possible to get this result: > > - link_to "http://www.example.com" do > - "www" > - "example" > - "com" > > => "wwwexamplecom" > >this is because you use -, use =. but that would leave a space in between the words. you might want to wrap each word in a span and remove the whitespace = link_to url do %span>= ''www'' %span>= ''example'' %span>= ''com''> So far I''ve only managed to get: > > => "com" > > Which is logical because of the way Ruby blocks work. But, it defeats the > HAML purpose of concatenating the things you put underneath each other. > > CmdJohnson > > -- > http://rubyonrailsdeveloper.nl > > -- > 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. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- 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.