title: undefined method `signed_id' for nil:NilClass
body: <p>A while back I tried to delete attachments of the active storage so I follow the answer of this question: <a href="https://stackoverflow.com/questions/49515529/rails-5-2-active-storage-purging-deleting-attachements">Rails 5.2 Active Storage purging/deleting attachements</a></p>
  
  <p>But after doing this:</p>
  
  <pre><code>def delete_image_attachment
    @image = ActiveStorage::Blob.find_signed(params[:id])
    @image.purge
    redirect_to collections_url
  end 
  </code></pre>
  
  <p>I start getting this error every time I entered a view with images or a link to the destroy method:</p>
  
  <p><a href="https://i.stack.imgur.com/2VagO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2VagO.jpg" alt="enter image description here"></a></p>
  
  <p>So I change the code a bit:</p>
  
  <p><em>routes.rb</em></p>
  
  <pre><code>match 'vehicles/:id/:image_id' =&gt; 'vehicles#delete_image_attachment', :via =&gt; :delete, :as =&gt; :delete_image_attachment
  </code></pre>
  
  <p><em>vehicles_controller.rb</em></p>
  
  <pre><code>def delete_image_attachment
    @image = ActiveStorage::Attachment.find(params[:image_id])
    @image.purge
    redirect_back(fallback_location: vehicles_path)
  end
  </code></pre>
  
  <p><em>in a view that I want to delete some image</em></p>
  
  <pre><code>&lt;% @vehicle.images.each do |img| %&gt;
    &lt;%= image_tag img %&gt;
    &lt;%= link_to delete_image_attachment_url(@vehicle, img), method: :delete, data: { confirm: 'Are you sure?' } %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>That kind of works for the vehicles that already existed, but when I create a new vehicle the same error appears in every view with an image of that vehicle.</p>
  
  <p>Does anyone knows what kind of error is this, and how can I fix it? 
  Also, there is any way to delete all data from active storage, like resetting the table?
  Thank you!</p>