Paperclip with nested form saving null values in db

I have a Attachment model and Reminder model. The Reminder has many
attachments and Attachment belongs to a Reminder. I have set up the
association and it works fine. I have defined
accepts_nested_attributes_for :attachments in the Reminder model also.
I have a nested form where there is multiple file upload fields. I am
using paperclip for saving file attachments. I have set up multipart
true to the form. But when I submit the form the Reminder model creates
an entry in db with Delayed Jobs but in the Attachment model null values
are getting saved in the db. Please find the part of my code below. Any
inputs /suggestions would be great…

<% form_for @reminder, :url => { :action => "create_reminder"

},:html=>{:multipart=>true} do |l| %>

<% l.fields_for :attachments do |a| %>
<%= render “message_addl_attachment_fields”,:f=>a %>
<% end %>

<%= link_to_add_addl_attachment “#{image_tag
“buttons/add_2.png” } #{t(‘add_txt’)}”, l, :attachments %>

<%=submit_tag “#{t(‘send’)}”, :class => ‘button’,
:disable_with => “#{t(‘please_wait’)}” %>

<% end %>
=====Controller code…
def create_reminder
      @recipients ={|a|
unless params[:reminder][:body] == “” or params[:recipients]
== “”
recipients_array = params[:recipients].split(",").reject{|a|
a.strip.blank?}.collect{ |s| s.to_i }
Delayed::Job.enqueue( =>,:recipient_ids =>
recipients_array,:subject=>params[:reminder][:subject],:body=>params[:reminder][:body])) “Before saving
attachments…#{@reminder.message_addl_attachments.inspect}” “After Saving

        flash[:notice] = "Message Sent Sucessfully"
        redirect_to :controller=>"reminder_plugin",

flash[:notice]=“Please fill the required fields”
redirect_to :controller=>“reminder_plugin”,
rescue Exception=> e
puts “Inside create action…”,e.backtrace