Use table for form fields in views

This commit is contained in:
Thibault Jouan 2011-09-07 21:13:20 +00:00
parent 1057cab009
commit acaa9fc19a
4 changed files with 45 additions and 20 deletions

View File

@ -1,4 +1,9 @@
= form_for @playlist do |f| = form_for @playlist do |f|
= f.label :name %table
= f.text_field :name %tbody
= f.submit submit_text %tr
%th= f.label :name
%td= f.text_field :name
%tfoot
%tr
%td= f.submit submit_text

View File

@ -1,7 +1,14 @@
= form_for(:session, :url => sessions_path) do |f| = form_for(:session, :url => sessions_path) do |f|
= f.label :email %table
= f.text_field :email %tbody
= f.label :password %tr
= f.password_field :password %th= f.label :email
= f.submit 'Sign in' %td= f.text_field :email
%tr
%th= f.label :password
%td= f.password_field :password
%tfoot
%tr
%td= f.submit 'Sign in'
= link_to 'Sign up', new_user_path = link_to 'Sign up', new_user_path

View File

@ -1,6 +1,12 @@
= form_for @track, :html => { :multipart => true } do |t| = form_for @track, :html => { :multipart => true } do |t|
= t.label :name %table
= t.text_field :name %tbody
= t.label :file %tr
= t.file_field :file %th= t.label :name
= t.submit 'Upload' %td= t.text_field :name
%tr
%th= t.label :file
%td= t.file_field :file
%tfoot
%tr
%td= t.submit 'Upload'

View File

@ -1,8 +1,15 @@
= form_for(@user, :url => users_path) do |f| = form_for(@user, :url => users_path) do |f|
= f.label :email %table
= f.text_field :email %tbody
= f.label :password %tr
= f.password_field :password %th= f.label :email
= f.label :password_confirmation %td= f.text_field :email
= f.password_field :password_confirmation %tr
= f.submit 'Sign up' %th= f.label :password
%td= f.password_field :password
%tr
%th= f.label :password_confirmation
%td= f.password_field :password_confirmation
%tfoot
%tr
%td= f.submit 'Sign up'