Hello,

I am attempting to use AS and attachment_fu together.  I see lots of
links to an explanation on the wiki, however as you are aware the wiki
is down. So...

I can add attachments without any issue at all.  However in the Update
view I want to show a list of attachments with an X beside each so
that one can delete the association to the Object being updated.

I want to override it, because I don't really want to display it the
default way AS will display it.

For clarity I should mention I have two types of attachments,
'confidential' and 'nonconfidential',   I am currently just trying to
override the confidential_attachments.

I looked at a couple of ways to do this, and had settled on doing a
partial override.  I tried to mimic the html structure as well as I
could in this partial, but when I submit the Update form,  the
'confidential_attachments' doesn't even show up in the hash, while the
'nonconfidential_attachments' do (since I am not overriding them I
presume).

I am wondering if anyone has any ideas.

Partial:

<h5>
  Confidential Attachments (<a class="visibility-toggle" onclick="e = $
(this.parentNode).next(); e.toggle(); this.innerHTML =
(e.style.display == 'none') ? 'show' : 'hide'; return false;"
href="#">hide</a>)
</h5>
<div >
<table cellpadding="0" cellspacing="0">
  <thead>
  <tr>
    <th>Filename</th>
  </tr>
  </thead>
<tbody id="compounds-<%= @record.id %>-confidential_attachments-
subform-list">
  <tr class="association-record-errors">
    <td colspan="3"></td>
  </tr>
<% unless @record.confidential_attachments.nil?
    @record.confidential_attachments.each do |attachment| %>
      <tr class="association-record">
        <td>
          <dl>
          <dt>
            <label for="record_filename">Filename</label>
          </dt>
          <dd>
            <input id="record_filename_<%= attachment.id %>"
class="filename-input text-input" type="text"
            value="<%= attachment.filename %>" size="20"
name="record[confidential_attachments][<%= attachment.id %>]
[filename]"
            autocomplete="off" disabled/>
          </dd>
        </dl>
        </td>
        <td class="actions">
           <a class="destroy" href="#" onclick="$
(this).up('.association-record').remove();return false;">Remove</a>
           <input type="hidden" value="<%= attachment.id %>"
name="record[confidential_attachments][<%= attachment.id %>][id]"/>
        </td>
      </tr>
  <% end %>
<% end %>
</table>
</div>


I hope I am being clear, and I apologize if I am not.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to