#92 open
Seth Engelhard

In parts, form tags in a part are being rendered separate from the form's content

Reported by Seth Engelhard | March 26th, 2008 @ 08:29 PM | in 1.0 (Nearish Future)

I am having a problem including a form in a Part view.

Here is an example of what I'm trying to do:

#right
  #member_login
    - form_tag(:action => url(:login)) do
      = text_field :name => :login
      = password_field :name => :password
      = submit_button 'Submit'

If this code is included in a regular view, it renders correctly:

<div id='right'>
  <div id='member_login'>
    <form action="/login" method="post" id="login"><div class='input_fields'>
      <input type="text" class="text" name="login" />
      <input type="password" class="password" name="password" />
      <button type="submit" class="btn submit">Submit</button>
    </form>
  </div>
</div>

However, if the same code is included in a part, the empty form tag gets rendered before the part while the contents of the form tag get rendered in the correct place within the part.

Part called in template:

= part (RightColumnPart => :default)

HTML rendered:

<form method="post" id="login" action="/login"></form>     <div id='right'>
  <div id='member_login'>
    <input type="text" class="text" name="login" />
    <input type="password" class="password" name="password" />
    <button type="submit" class="btn submit">Submit</button>
  </div>
</div>

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket