# GET and POST problem in URL access

**URL:** <https://discuss.rubyonrails.org/t/get-and-post-problem-in-url-access/28360>\
**Category:** rubyonrails-talk\
**Created:** [April 22, 2008, 6:53am UTC](https://discuss.rubyonrails.org/t/get-and-post-problem-in-url-access/28360 "2008-04-22T06:53:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 22, 2008, 6:53am UTC](https://discuss.rubyonrails.org/t/get-and-post-problem-in-url-access/28360/1 "2008-04-22T06:53:11Z")

</div>

Hi,

My controller code is,

class MyController \< ApplicationController &nbsp;&nbsp;def my\_method &nbsp;&nbsp;&nbsp;&nbsp;puts "Inside my method" &nbsp;&nbsp;end end

In my routes.rb: map.resources :my\_controller, :collections =\> {:my\_method =\> :post}

I have implemented the user authentication also. After login, when I try to access the URL '[http://localhost:3000/my\_controller/my\_method](http://localhost:3000/my_controller/my_method)’ it shows the following error.

Unknown action No action responded to show

This is because GET request is sent to the controller. It must be POST. How can I make the method as POST?

Thanks in advance...

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 22, 2008, 7:01am UTC](https://discuss.rubyonrails.org/t/get-and-post-problem-in-url-access/28360/2 "2008-04-22T07:01:26Z")

</div>

Solved the problem. I had made a mistake in passing URL.

The URL should be '[http://localhost:3000/my\_controller/my\_method/1](http://localhost:3000/my_controller/my_method/1)’.
