String concatenation question

I am outputting an RSS file.

In my feed.rxml
xml.description advert.description + image_tag
url_for_file_column(advert, “image”,“thumb”) unless
url_for_file_column(advert, “image”,“thumb”).nil?

I want to concatenate the advert.description + image_tag to show the
description and the image. I keep on getting a compile error.

How can I concatenate these two?

Your going to need to put brackets round those method calls. Ruby
probably assumes that the first line is the only line of that statement
(and thus doesn’t see the parameters passed to image_tag.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs