Be seen. Boost your question’s priority for more expert views and faster solutions
def save_attachment @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 logger.silence do result = @attachment.save end if result update_event(@program.event) flash[:notice] = "Upload successful" redirect_to :controller => :main, :action => :show_event, :id => @program.event end end end
Join the community of 500,000 technology professionals and ask your questions.