I am facing an issue with displaying a form horizontally instead of vertically in a partial triggered by AJAX on my main page. I have tried various methods like using <form class="form-inline">
,
<%=f.number_field :pointsSpend, :class => "checkbox inline"%>
with css display: inline
, but none of them seem to work.
The main form where the partial is rendered:
<div class="row">
<div class="col-md-12">
<%= link_to image_tag("biceps.jpg"),'#', id: 'ChallengeButton', class: "btn btn-lg btn-primary" %>
<div id="challengeCentre"></div>
</div>
</div>
The form:
<%= form_for(@challenge) do |f| %>
<% if @challenge.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@challenge.errors.count, "error") %> prohibited this challenge from being saved:</h2>
<ul>
<% @challenge.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :pointsSpend %><br>
<%= f.number_field :pointsSpend %>
</div>
<div class="field">
<%= f.label :rules %><br>
<%= f.text_area :rules %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
</form>