问题
I am using rails-bootstrap-forms gem with devise. How i can customize form_tag with bootstrap with gem rails-bootstrap-forms. My code is
<%= form_tag topic_posts_path(@topic) do %>
<%= render 'form' %>
<%= submit_tag 'Create post' %>
<%end%>
and my partial _form is
<h2>Create new post</h2>
<%= label :post, :description %>
<%= text_area :post, :description %>
I want something like
<div class="form-group">
<label for="xyz">xyz</label>
<input type="email" class="form-control" id="xyz" placeholder="Enter xyz">
</div>
any help ?
回答1:
So what you want is to have input fields wrapped with <div class="form-group">...</div>
. Replace form_tag
with bootstrap_form_for
. Replace text_area
with f.text_area
. That's how you already got your signup form work.
来源:https://stackoverflow.com/questions/27334652/i-am-using-rails-bootstrap-forms-gem-with-devise-form-tag