# Problem with new action

**URL:** <https://www.ruby-forum.com/t/problem-with-new-action/150948>\
**Category:** Rails\
**Created:** [October 15, 2008, 4:55am UTC](https://www.ruby-forum.com/t/problem-with-new-action/150948 "2008-10-15T04:55:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JHuizingh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8797f3/32.png) [@JHuizingh](https://www.ruby-forum.com/u/JHuizingh)\
**Post date:** [October 15, 2008, 4:55am UTC](https://www.ruby-forum.com/t/problem-with-new-action/150948/1 "2008-10-15T04:55:19Z")

</div>

I’m having issues submitting a form to the create action.

In routes I have

map.resources :encryption\_passphrases

This resource is not using an ActiveRecord model, so I can’t use the  
form\_for method in the view.

In app/views/encryption\_passphrases/new.html.erb I have this:

\<% form\_tag(encryption\_passphrases\_url, :method =\> “post”) do |f| %\>

\<%= password\_field\_tag :encryption\_passphrase %\>

\<%= submit\_tag "Create" %\>

\<% end %\>

This results in the following html:

When I hit the Create button, I get this error on the resulting page:

“Unknown action  
No action responded to index”

I don’t know why it’s going to the get http method because it says  
post in the form tag.

Can anybody tell me how to fix this?

Thanks,

Jonathan

---

<div class="post-metadata">

**Author:** ![JHuizingh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8797f3/32.png) [@JHuizingh](https://www.ruby-forum.com/u/JHuizingh)\
**Post date:** [October 15, 2008, 5:34pm UTC](https://www.ruby-forum.com/t/problem-with-new-action/150948/2 "2008-10-15T17:34:51Z")

</div>

Try running “rake routes” to see if the URL you get is recognized as a  
resource url. Maybe the :controller/:action/:id route outranks your  
resources route. The resources route should be specified higher up in  
the file.

---

<div class="post-metadata">

**Author:** ![JHuizingh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8797f3/32.png) [@JHuizingh](https://www.ruby-forum.com/u/JHuizingh)\
**Post date:** [October 16, 2008, 12:46am UTC](https://www.ruby-forum.com/t/problem-with-new-action/150948/3 "2008-10-16T00:46:13Z")

</div>

Christina,

Thanks for the response.

This is what my rake routes command outputs. The  
encryption\_passphrases resource is at the top of everything in the  
application. The :controller/:action/:id route is at the very bottom.

```
          encryption_passphrases GET /

```

encryption\_passphrases  
{:controller=\>“encryption\_passphrases”, :action=\>“index”}  
formatted\_encryption\_passphrases GET /  
encryption\_passphrases.:format  
{:controller=\>“encryption\_passphrases”, :action=\>“index”}  
POST /  
encryption\_passphrases  
{:controller=\>“encryption\_passphrases”, :action=\>“create”}  
POST /  
encryption\_passphrases.:format  
{:controller=\>“encryption\_passphrases”, :action=\>“create”}  
new\_encryption\_passphrase GET /encryption\_passphrases/  
new  
{:controller=\>“encryption\_passphrases”, :action=\>“new”}  
formatted\_new\_encryption\_passphrase GET /encryption\_passphrases/  
new.:format  
{:controller=\>“encryption\_passphrases”, :action=\>“new”}  
edit\_encryption\_passphrase GET /  
encryption\_passphrases/:id/edit  
{:controller=\>“encryption\_passphrases”, :action=\>“edit”}  
formatted\_edit\_encryption\_passphrase GET /  
encryption\_passphrases/:id/edit.:format  
{:controller=\>“encryption\_passphrases”, :action=\>“edit”}  
encryption\_passphrase GET /  
encryption\_passphrases/:id  
{:controller=\>“encryption\_passphrases”, :action=\>“show”}  
formatted\_encryption\_passphrase GET /  
encryption\_passphrases/:id.:format  
{:controller=\>“encryption\_passphrases”, :action=\>“show”}  
PUT /  
encryption\_passphrases/:id  
{:controller=\>“encryption\_passphrases”, :action=\>“update”}  
PUT /  
encryption\_passphrases/:id.:format  
{:controller=\>“encryption\_passphrases”, :action=\>“update”}  
DELETE /  
encryption\_passphrases/:id  
{:controller=\>“encryption\_passphrases”, :action=\>“destroy”}  
DELETE /  
encryption\_passphrases/:id.:format  
{:controller=\>“encryption\_passphrases”, :action=\>“destroy”}  
.  
.  
. {other controllers}  
.  
/:controller/:action/:id  
/:controller/:action/:id.:format

I’ve worked around the issue by causing the index action to call the  
create method, but I’d rather have it work as designed…

Any other suggestions?

Thanks,  
Jonathan
