Ruby on Rails Monday, August 29, 2011



On Tue, Aug 30, 2011 at 12:02 AM, Commander Johnson <commanderjohnson@gmail.com> 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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment