Forum: Ruby on Rails Problems with form_for( ...)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
comopasta G. (Guest)
on 2009-03-30 22:43
Hi, I'm puzzled by the next.

I have messages that have attachments.
I have an index action for the attachments where I list all the
attachments that a message has. From the same index page I can also add
new attachments to that message.

For that I've been using the next form

<% form_for(, :html => { :multipart => true })
do |f| %>
  <%= hidden_field_tag 'mess', %>
  <p>Attachment: <%= f.file_field :uploaded_data, :size => "20" %></p>
  <%= submit_tag('Attach', { :class => "bigButton" }) %>
<% end %>

In my local environment (upgraded now to Rails 2.3.2, I originally did
this in Rails 2.1.2) that sends a request to the Create method of the
attachments controller as expected.

However in the real server (Rails 2.1.2) the same sends a request to the
Index method of the attachments controller.

Anyone sees a reason why it goes to the Index method in the real server?
Maybe something is different in those versions (?)

comopasta G. (Guest)
on 2009-03-31 01:28

Fixed thanks to a suggestion from:

This topic is locked and can not be replied to.