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(@message.attachments.build, :html => { :multipart => true
})
do |f| %>
<%= hidden_field_tag ''mess'', @message.id %>
<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 (?)
Thanks.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
comopasta Gr
2009-Mar-30 21:28 UTC
Re: Problems with form_for(@message.attachments.build ...)
Hi, Fixed thanks to a suggestion from: http://railsforum.com/viewtopic.php?id=28784 Cheers. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---