# How to strucutre application

**URL:** <https://www.ruby-forum.com/t/how-to-strucutre-application/71957>\
**Category:** Rails\
**Created:** [October 12, 2006, 9:30pm UTC](https://www.ruby-forum.com/t/how-to-strucutre-application/71957 "2006-10-12T21:30:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim\_dandy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@jim\_dandy](https://www.ruby-forum.com/u/jim_dandy)\
**Post date:** [October 12, 2006, 9:30pm UTC](https://www.ruby-forum.com/t/how-to-strucutre-application/71957/1 "2006-10-12T21:30:15Z")

</div>

My application needs to make a call to a webservice via an HTTP post.  
The webservice responds with an integer and a string. I’ve got this  
working.

I need to call this web service from a couple of different controllers.  
I don’t want it to render a view. Would I put this functionality in  
application\_helper.rb or where would the best place be to put this?

Regards,

---

<div class="post-metadata">

**Author:** ![jim\_dandy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@jim\_dandy](https://www.ruby-forum.com/u/jim_dandy)\
**Post date:** [October 13, 2006, 2:18am UTC](https://www.ruby-forum.com/t/how-to-strucutre-application/71957/2 "2006-10-13T02:18:15Z")

</div>

What I’ve done in the past is have a FooProxy class tha handles the  
details of talking to the webservice in question. It also makes testing  
a little easier since I just have to mock out the FooProxy class.

Fred

---

<div class="post-metadata">

**Author:** ![jim\_dandy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@jim\_dandy](https://www.ruby-forum.com/u/jim_dandy)\
**Post date:** [October 18, 2006, 10:39am UTC](https://www.ruby-forum.com/t/how-to-strucutre-application/71957/3 "2006-10-18T10:39:16Z")

</div>

On Oct 12, 2006, at 12:30 PM, jim dandy wrote:

> My application needs to make a call to a webservice via an HTTP post.  
> The webservice responds with an integer and a string. I’ve got this  
> working.
> 
> I need to call this web service from a couple of different  
> controllers.  
> I don’t want it to render a view. Would I put this functionality in  
> application\_helper.rb or where would the best place be to put this?

There, or a model of it’s own.

–  
– Tom M., CTO  
– Engine Y., Ruby on Rails Hosting  
– Reliability, Ease of Use, Scalability  
– (866) 518-YARD (9273)
