Radio buttons causing line-breaks

Hello there - I’m pretty much a newbie to Rails and a complete newbie to
this forum.
I’ve had a quick look for a FAQ for the forum but seem unable to find
one. If I’ve committed any major faux-pas, please forgive me :slight_smile:

My problem is with a form that (I believe) is being generated at least
partially by some Rails magic.

Some radio buttons in this form are pushing the accompanied text
downwards, so rather than it looking like this:

o Text1
o Text2

It looks more like this:

o
Text1
o
Text2

The code that generates this bit is as below, lurking in
views/addresses/_addresses_list.rhtml

<% address_id_param = params["#{address_name}_id"] %>
<% if @addresses and !@addresses.empty? %>

<% for address in @addresses %>
    <%= address_radio_button_tag address, address_name, 

address_id_param.to_i %>
<%= address.city %>: <%= address.line_one %>

<% end %>
<%= new_address_radio_button_tag address_name, address_id_param %>
Add a new address<br/>

<% else %>
<%= render :partial => ‘/addresses/form’, :locals => { :address_name
=> address_name } %>
<% end %>

The layout of this section is styled by a a CSS element:
#form_container. I suspect, from reading some other posts on here, that
a display: inline; line in the right place should get the text behaving
the way it ought to.

Sadly, I’m pretty new to CSS too, so while I’ve spent a large part of
the afternoon trying various things, I’ve yet to hit on the solution.

I hope this wasn’t too long a post - any advice / pointers to some
reading would be very gratefully appreciated.

Thank you for your time,

Dave

I would look at the output HTML. Certain elements have a line break
like you are talking about. (DIV and SPAN are a couple fo examples.)
Spend a few minutes following the simple tutorial here:

http://www.w3schools.com/css/default.asp

I expect that setting a display:inline with the correct selector should
fix your problem.

Sorted - thank you very much for your advice, Steve.

Regards,

Dave

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