Discussion:
Upload image
Ml Ml
18 years ago
Permalink
My problem is because of the following message :
undefined method `original_filename' for "Arellano.pdf":String

controller :

params[:vestuario][:nombre] =
sanitize_filename(params[:vestuario][:nombre])
params[:vestuario][:nombre] =
@params[:vestuario][:nombre].original_filename
params[:vestuario][:adjunto]= @params[:vestuario][:nombre].read

view :

<%= error_messages_for "vestuario" %>
<%= start_form_tag({:action =>
'create'},{:enctype=>"multipart/form-data"},{:multipart => true}) %>
<!--[form:vestuario]-->
<p><label for="vestuario_titulo">Titulo</label><br/>
<%= text_field 'vestuario', 'titulo' %></p>

<p><label for="vestuario_descripcion">Descripcion</label><br/>
<%= text_area 'vestuario', 'descripcion' %></p>

<p><label for="vestuario_fecha">Fecha</label><br/>
<%= date_select 'vestuario', 'fecha' %></p>

<p><label for="vestuario_nombre">Imagen</label><br/>
<%= file_field('vestuario', 'nombre', :size => "70") %></p>
<p>
<%= submit_tag "Crear nuevo documento" %>
<%= end_form_tag %>

What would be the problem ?
--
Posted via http://www.ruby-forum.com/.
Loading...