# How to call controller from a div

**URL:** <https://www.ruby-forum.com/t/how-to-call-controller-from-a-div/60905>\
**Category:** Rails\
**Created:** [May 18, 2006, 1:24pm UTC](https://www.ruby-forum.com/t/how-to-call-controller-from-a-div/60905 "2006-05-18T13:24:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bing](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@Bing](https://www.ruby-forum.com/u/Bing)\
**Post date:** [May 18, 2006, 1:24pm UTC](https://www.ruby-forum.com/t/how-to-call-controller-from-a-div/60905/1 "2006-05-18T13:24:12Z")

</div>

Hi guys,

it’s me again,

Just wanted to ask, what technique can you use to call a def inside your  
controller while clicking on a div?

thanks,

Bing

---

<div class="post-metadata">

**Author:** ![Bing](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@Bing](https://www.ruby-forum.com/u/Bing)\
**Post date:** [May 18, 2006, 4:24pm UTC](https://www.ruby-forum.com/t/how-to-call-controller-from-a-div/60905/2 "2006-05-18T16:24:15Z")

</div>

does reading the manual about link\_to help you?

> **[ActionView::Helpers::UrlHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M000378)**
>
> Provides a set of methods for making links and getting URLs that depend on the routing subsystem (see ActionDispatch::Routing).

---

<div class="post-metadata">

**Author:** ![Bing](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@Bing](https://www.ruby-forum.com/u/Bing)\
**Post date:** [May 18, 2006, 4:33pm UTC](https://www.ruby-forum.com/t/how-to-call-controller-from-a-div/60905/3 "2006-05-18T16:33:38Z")

</div>

Ouch!

---

<div class="post-metadata">

**Author:** ![Bing](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@Bing](https://www.ruby-forum.com/u/Bing)\
**Post date:** [May 19, 2006, 7:26am UTC](https://www.ruby-forum.com/t/how-to-call-controller-from-a-div/60905/4 "2006-05-19T07:26:48Z")

</div>

Hey Nicolas,

thanks, will give it a try. I can’t use link\_to it seems bec it needs to  
redirect to another url. I may need to use link\_to\_remote.

thanks,

bing
