Skip to content

Instantly share code, notes, and snippets.

@abhas
Created December 12, 2011 10:36
Show Gist options
  • Select an option

  • Save abhas/1466484 to your computer and use it in GitHub Desktop.

Select an option

Save abhas/1466484 to your computer and use it in GitHub Desktop.

Revisions

  1. Abhas Abhinav revised this gist Dec 12, 2011. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions gistfile1.haml
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    = f.fields_for :attachments do |att|
    = att.label :file
    .input
    - if att.object.new?
    = att.file_field :file
    - else
    = att.object.file_name
    - if att.object.new?
    = att.file_field :file
    - else
    = att.object.file_name
  2. Abhas Abhinav revised this gist Dec 12, 2011. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.haml
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@

    = f.fields_for :attachments do |att|
    = att.label :file
    .input
    - if att.object.new?
    = att.file_field :file
    - else
    = att.object.file_name
    = att.object.file_name
  3. Abhas Abhinav created this gist Dec 12, 2011.
    8 changes: 8 additions & 0 deletions gistfile1.haml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@

    = f.fields_for :attachments do |att|
    = att.label :file
    .input
    - if att.object.new?
    = att.file_field :file
    - else
    = att.object.file_name