I am uploading a file as follows (snippet attached). I would like to know whats the id(database column) of this uploaded file. Is there any way I can get it?
@program = @object
@attachment = Attachment.new
if request.post? && params[:attachment]
@attachment = @program.attachments.build(params[:attachment])
@attachment.name = @attachment.filename if @attachment.name.blank?
result = false
result = @attachment.save
flash[:notice] = "Upload successful"
redirect_to :controller => :main, :action => :show_event, :id => @program.event