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

  = f.input :title
  = f.input :file, :as => :file
  = f.input :code, :as => :select, :collection => Attachment.codes
  - 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

= 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, :as => :select, :collection => Attachment.codes
    - 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

Add missing inputs container to attachments form.
Add missing inputs container to attachments form.
