Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Label is getting displayed below checkbox

<%= f.check_box :openid_enabled %>
<%= f.label :openid_enabled, 'OpenID' %>

Above code generate this HTML

<input type="hidden" value="0" name="application[openid_enabled]">
<input type="checkbox" value="1" name="application[openid_enabled]" id="application_openid_enabled">
<label for="application_openid_enabled">OpenID</label>

and the label is getting displayed like

[x]
OpenID

instead of

[x] OpenID

Do I need to style it or rails helpers have some build in functionality?

Added

I am using twitter bootstrap CSS framework in my Rails application.

like image 231
Amit Patel Avatar asked Aug 20 '12 11:08

Amit Patel


1 Answers

This must be happening because either input or label is set as display: block; You can show it in one line by making these elements inline -

input, label{ display: inline; }
like image 150
Dipak Avatar answered Oct 26 '22 07:10

Dipak