Try the following steps:

1. Remove :url => { :action => "update" }, you do not need this as the
[...@academy, @ecourse ] will generate the correct path and the :html =>
{:method => :put} will generate the correct method for submission

2. Check that @academy is not nil, but off the top of my head I think
it would generate an incorrect path and would raise an error

3. The method has been generated correctly. See: <input name="_method"
type="hidden" value="put" /> This is a Rails hack as browsers do not
support the 'put' method natively. That's why you still see 'post' in
the actual form tag.

HTH,
Nicholas

On Jun 15, 1:45 pm, Erwin <[email protected]> wrote:
> In my view I wrote the following :
>
> <% form_for [...@academy, @ecourse ], :url => { :action =>
> "update" }, :html => {:method => :put} do |f| %>
>
> but it's generating the html code :
>
> <form action="/ecourses/4" class="edit_ecourse" id="edit_ecourse_4"
> method="post">
> <div style="margin:0;padding:0"><input name="_method" type="hidden"
> value="put" />
> .....
>
> rather than action : /academies/1/ecourses/4..   and the method is
> still 'post'
>
> I am sure to be wrong but where ?
>
> thanks fyh
>
> erwin
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to