# ActionController::UnknownAction (No action responded to 22

**URL:** <https://www.ruby-forum.com/t/actioncontroller-unknownaction-no-action-responded-to-22/173365>\
**Category:** Rails\
**Created:** [August 7, 2009, 10:10am UTC](https://www.ruby-forum.com/t/actioncontroller-unknownaction-no-action-responded-to-22/173365 "2009-08-07T10:10:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexei-lexx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@alexei-lexx](https://www.ruby-forum.com/u/alexei-lexx)\
**Post date:** [August 7, 2009, 10:10am UTC](https://www.ruby-forum.com/t/actioncontroller-unknownaction-no-action-responded-to-22/173365/1 "2009-08-07T10:10:40Z")

</div>

I try to switch my application from Rails 2.2.2 to Rails 2.3.3.

In namespace :admin I have a resource-based controller. See controller  
class Admin::OSystemsController \< Admin::BaseController  
def index  
…  
end

def edit  
…  
end

def update  
…  
end  
end

Resource is added to routes.rb like  
map.namespace :admin do |admin|  
…  
admin.resources :o\_systems, :only =\> [:index, :edit, :update]  
…  
end

I go to edit page (see view)  
…  
\<% form\_for([:admin, @o\_system]) do |f| %\>  
\<%= f.error\_messages %\>  
…  
\<% end %\>

I press submit and exception is thrown:  
ActionController::UnknownAction (No action responded to 22. Actions:  
edit, index, and update):. Here “22” is the id of the object.

Everything works properly in development, error is only in production  
environment and only ONE time. If I submit form second time then  
everything goes well.

Please, help.

---

<div class="post-metadata">

**Author:** ![alexei-lexx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@alexei-lexx](https://www.ruby-forum.com/u/alexei-lexx)\
**Post date:** [August 7, 2009, 5:50pm UTC](https://www.ruby-forum.com/t/actioncontroller-unknownaction-no-action-responded-to-22/173365/2 "2009-08-07T17:50:15Z")

</div>

Alexei Lexx wrote:

> Everything works properly in development, error is only in production  
> environment and only ONE time. If I submit form second time then  
> everything goes well.
> 
> Please, help.

Sounds like a stale session issue, are you clearing your sessions out  
when you deploy to production??

---

<div class="post-metadata">

**Author:** ![alexei-lexx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@alexei-lexx](https://www.ruby-forum.com/u/alexei-lexx)\
**Post date:** [August 7, 2009, 8:31pm UTC](https://www.ruby-forum.com/t/actioncontroller-unknownaction-no-action-responded-to-22/173365/3 "2009-08-07T20:31:06Z")

</div>

Ilan B. wrote:

> Alexei Lexx wrote:
> 
> > Everything works properly in development, error is only in production  
> > environment and only ONE time. If I submit form second time then  
> > everything goes well.
> > 
> > Please, help.
> 
> Sounds like a stale session issue, are you clearing your sessions out  
> when you deploy to production??

I use memcahed sessions.

---

<div class="post-metadata">

**Author:** ![alexei-lexx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@alexei-lexx](https://www.ruby-forum.com/u/alexei-lexx)\
**Post date:** [August 8, 2009, 10:52am UTC](https://www.ruby-forum.com/t/actioncontroller-unknownaction-no-action-responded-to-22/173365/4 "2009-08-08T10:52:57Z")

</div>

Ilan B. wrote:

> Alexei Lexx wrote:
> 
> > I use memcahed sessions.
> 
> clear your memcached sessions prior to deployment to production…  
> development and production are using the same memcache?

No of course, development and productions are different servers.

I restarted memcached to clear sessions and then restarted mongrel.  
Problem still exists.

---

<div class="post-metadata">

**Author:** ![alexei-lexx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@alexei-lexx](https://www.ruby-forum.com/u/alexei-lexx)\
**Post date:** [August 7, 2009, 8:50pm UTC](https://www.ruby-forum.com/t/actioncontroller-unknownaction-no-action-responded-to-22/173365/5 "2009-08-07T20:50:40Z")

</div>

Alexei Lexx wrote:

> I use memcahed sessions.

clear your memcached sessions prior to deployment to production…  
development and production are using the same memcache?
