# Form invoking wrong action

**URL:** <https://www.ruby-forum.com/t/form-invoking-wrong-action/109854>\
**Category:** Rails\
**Created:** [July 19, 2007, 5:39pm UTC](https://www.ruby-forum.com/t/form-invoking-wrong-action/109854 "2007-07-19T17:39:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnstevenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Post date:** [July 19, 2007, 5:39pm UTC](https://www.ruby-forum.com/t/form-invoking-wrong-action/109854/1 "2007-07-19T17:39:13Z")

</div>

I have a form that is supposed to call the ‘create\_asset\_type\_property’  
action. For some reason, it always invokes the action ‘update’, and  
gives me the error message “Unknown action: No action responded to  
update”. Any ideas why?

Here’s the form…

\<% form\_remote\_tag(  
:url =\> url\_for(:action =\> ‘create\_asset\_type\_property’),  
:html =\> { :asset\_type\_id =\> asset\_type.id },  
:complete =\> “$(‘createAssetPropertyNameField’).value = ‘’;” +  
“$(‘createAssetPropertyDescriptionField’).value = ‘’;”  
) do %\>  
blah blah blah  
\<% end %\>

My action is in the controller…

def create\_asset\_type\_property  
@ … create and save the data here …

render :update do |page|  
page.replace\_html “assetTypePropertyListContainer”, :partial =\>  
‘asset\_type\_property\_list\_table’  
end  
end

---

<div class="post-metadata">

**Author:** ![dnstevenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Post date:** [July 19, 2007, 5:45pm UTC](https://www.ruby-forum.com/t/form-invoking-wrong-action/109854/2 "2007-07-19T17:45:46Z")

</div>

Nevermind… I think I found the cause, which is just a stupid mistake.

---

<div class="post-metadata">

**Author:** ![dnstevenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Post date:** [July 19, 2007, 5:49pm UTC](https://www.ruby-forum.com/t/form-invoking-wrong-action/109854/3 "2007-07-19T17:49:38Z")

</div>

did you create a route for your action ?  
if you create your route like this:  
map.resource :asset\_types, :member =\> {:create\_asset\_type\_property =\>  
:post}  
I think you have to pass :id =\> asset\_type.id in your url\_for  
(all depending on the name of your controller of course)
