Created
January 20, 2015 03:36
-
-
Save ExByt3s/7e13e98818d4c7b99488 to your computer and use it in GitHub Desktop.
`original_filename'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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