views:

16

answers:

1

I have done the following form

<% form_for @anexo, :url => {:action => "create"}, :html => {:multpart => true} do |f| %>

<%= f.error_messages %>

<p>
 <%= f.label :descricao, "Descrição"%>
 <%= f.text_field :descricao %>
</p>
<p>
 <%= f.label :arquivo_anexo, "Arquivo Anexo" %>
 <%= f.file_field :arquivo_anexo %>
</p>
<p>
 <%= f.submit "Adicionar anexo" %>
</p>

<% end %>

With a model like this:

def arquivo_anexo=(novo_arqquivo)
    self.arquivo = novo_arquivo.read
    self.nome = File.basename(novo_arquivo.original_filename)
    self.content_type = novo_arquivo.content_type.chomp
  end

But when I my file is not been sent through the form. When I check the params array using the debugger the data is not sent.

Does anyone have any idea or sugestions? Thanks

+1  A: 

Just a quick guess, but could it be that you have:

:multpart => true

instead of:

:multipart => true

(i.e. you're missing an i)

jerhinesmith
Thanks a lot. I feel embaraced right now. :(
VinTem
No worries, it happens to all of us. :)
jerhinesmith