= semantic_form_for parent? ? [parent, resource] : resource do |f|
  = f.semantic_errors

  = f.inputs do
    = f.input :title
    = f.input :file, :as => :file
    = f.input :code, :collection => attachment_code_collection
    - if parent?
      - if parent
        - f.object.object = parent
        = f.input :object_id, :as => :hidden
        = f.input :object_type, :as => :hidden
      - else
        = f.input :object, :collection => parent_class.all

  = f.buttons do
    = f.commit_button

.well
  = semantic_form_for parent? ? [parent, resource] : resource, :class => 'well' do |f|
    = f.semantic_errors

    = f.inputs do
      .row-fluid
        = f.input :title, :input_html => {:class => 'span12'}

      .row-fluid
        .span6
          = f.input :file, :as => :file
        .span6
          = f.input :code, :collection => attachment_code_collection

        - if parent?
          - if parent
            - f.object.object = parent
            = f.input :object_id, :as => :hidden
            = f.input :object_type, :as => :hidden
          - else
            = f.input :object, :collection => parent_class.all

    .form-actions
      = f.buttons do
        = f.commit_button

Use multi column form for attachments.
Use multi column form for attachments.
