# Using get and put

**URL:** <https://www.ruby-forum.com/t/using-get-and-put/155932>\
**Category:** Rails\
**Created:** [December 18, 2008, 9:53am UTC](https://www.ruby-forum.com/t/using-get-and-put/155932 "2008-12-18T09:53:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishal\_mehta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e480ec/32.png) [@vishal\_mehta](https://www.ruby-forum.com/u/vishal_mehta)\
**Post date:** [December 18, 2008, 9:53am UTC](https://www.ruby-forum.com/t/using-get-and-put/155932/1 "2008-12-18T09:53:51Z")

</div>

Hello everyone,  
I am new to rails and I am trying to run simple get post put methods  
in ruby rails. Can any one tell me where do I implement that methods.  
Can you provide any source where I can go through and learn these  
methods…  
Thanks…

---

<div class="post-metadata">

**Author:** ![vishal\_mehta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e480ec/32.png) [@vishal\_mehta](https://www.ruby-forum.com/u/vishal_mehta)\
**Post date:** [December 18, 2008, 12:59pm UTC](https://www.ruby-forum.com/t/using-get-and-put/155932/2 "2008-12-18T12:59:16Z")

</div>

Hi Vishal,

You can do the same in one single method in any controller and check  
request.method which will have methods ‘get’ or ‘post’  
def my\_method  
if :post == request.method  
#Process post  
else  
#Process get - usually just render the form  
end  
end

Regards,  
Vishwanath
