# Call 2 methods using action

**URL:** <https://www.ruby-forum.com/t/call-2-methods-using-action/103980>\
**Category:** Rails\
**Created:** [May 12, 2007, 8:30am UTC](https://www.ruby-forum.com/t/call-2-methods-using-action/103980 "2007-05-12T08:30:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [May 12, 2007, 8:30am UTC](https://www.ruby-forum.com/t/call-2-methods-using-action/103980/1 "2007-05-12T08:30:52Z")

</div>

hello

I want to know if there is ne method or way by which we can call 2  
methods using hte action function

something like :action =\>‘create’,‘update’

please let me know

thanks

dhaval

---

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [May 12, 2007, 12:20pm UTC](https://www.ruby-forum.com/t/call-2-methods-using-action/103980/2 "2007-05-12T12:20:18Z")

</div>

dhaval,

> I want to know if there is ne method or way by which we can call 2  
> methods using hte action function  
> something like :action =\>‘create’,‘update’

Do you have a real use case?  
I’ve never needed this except for AJAX related actions where you can  
use code like this :

## In the view:

\<%= link\_to\_remote “1 click, 2 actions”,  
:url =\> { :action =\> “first”},  
:complete =\> remote\_function(:url =\> { :action =\> :second })  
%\>

## In the controller :

def first  
# non AJAX stuff here  
render (:update) {|page|page.alert(“foo”)}  
end  
def second  
render (:update) {|page|page.alert(“bar”)}  
end

## Alain R.

[blog.ravet.com/](http://blog.ravet.com/)
