Skip to content

Instantly share code, notes, and snippets.

@ExByt3s
Created January 20, 2015 03:36
Show Gist options
  • Save ExByt3s/7e13e98818d4c7b99488 to your computer and use it in GitHub Desktop.
Save ExByt3s/7e13e98818d4c7b99488 to your computer and use it in GitHub Desktop.
`original_filename'
undefined method `original_filename' for "4896_EN_ROW_W52_Phones_868x250_12_12_2014_4_35_30_784.jpg":String
def create
@audition = Audition.create(_audition_param_)
@retail = @audition.retails.build(rettailram)
@imagenes = @audition.imagens.build(imagen_attributes)
uploaded_io = params[:Imagen][:ico]
File.open(Rails.root.join('public', 'data', uploaded_io.original_filename), 'wb') do |file|
file.write(uploaded_io.read)
end
if @audition.save
flash[:notice] = "Aricle successfully created"
redirect_to
else
render :new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment