AdamNYC
AdamNYC

Reputation: 20445

Styling a form_tag

I have the following form:

  = form_tag '/posts', {id: "link-form"} do
    = text_field :post, :link
    = submit_tag "Add link", {id: "submit-button"}

, which renders:

<form accept-charset="UTF-8" action="/posts" id="link-form" method="post">
    <div style="margin:0;padding:0;display:inline">
        <input id="post_link" name="post[link]" type="text">
         <input id="submit-button" name="commit" type="submit" value="Add link">
 </form>

It seems that Rails automatically add another div in the second line: <div style="margin:0;padding:0;display:inline">

This div inherits everything from its parents, and I can't get access to this div (such as assigning an ID) to change its appearance.

How I can access this div, or how to go around it?

Upvotes: 1

Views: 351

Answers (1)

MaxKonin
MaxKonin

Reputation: 468

Its div for hidden inputs with existing data. You do not have to touch it.

Upvotes: 1

Related Questions