html - Erb: How to make a block repeat horizontally? -


if have block of following format:

<% @model.each |f| %>   <%= f.name %>   <%= image_tag("some_picture.jpg") %>   <br> <% end %> 

how repeat horizontally, instead of vertically? if list long enough reach end of containing div, continue line down, normal html text.

this concatenates names array using array#join single space between them:

<%= @model.map(&:name).join(' ') %> 

wrapping within paragraph element give looking for:

<%= content_tag(:p, @model.map(&:name).join(' ')) %> 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -