# GET and POST problem in URL access

**URL:** <https://www.ruby-forum.com/t/get-and-post-problem-in-url-access/135442>\
**Category:** Rails\
**Created:** [April 22, 2008, 8:53am UTC](https://www.ruby-forum.com/t/get-and-post-problem-in-url-access/135442 "2008-04-22T08:53:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikeyan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/898d66/32.png) [@karthikeyan](https://www.ruby-forum.com/u/karthikeyan)\
**Post date:** [April 22, 2008, 8:53am UTC](https://www.ruby-forum.com/t/get-and-post-problem-in-url-access/135442/1 "2008-04-22T08:53:11Z")

</div>

Hi,

My controller code is,

class MyController \< ApplicationController  
def my\_method  
puts “Inside my method”  
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:** ![karthikeyan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/898d66/32.png) [@karthikeyan](https://www.ruby-forum.com/u/karthikeyan)\
**Post date:** [April 22, 2008, 9:01am UTC](https://www.ruby-forum.com/t/get-and-post-problem-in-url-access/135442/2 "2008-04-22T09: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)’.
