# Activate a tab after an ajax call

**URL:** <https://www.ruby-forum.com/t/activate-a-tab-after-an-ajax-call/137231>\
**Category:** Rails\
**Created:** [May 10, 2008, 12:52pm UTC](https://www.ruby-forum.com/t/activate-a-tab-after-an-ajax-call/137231 "2008-05-10T12:52:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [May 10, 2008, 12:52pm UTC](https://www.ruby-forum.com/t/activate-a-tab-after-an-ajax-call/137231/1 "2008-05-10T12:52:57Z")

</div>

Hi  
My main file has the following format (differnt tabs)

- Details
- Resolution
- Attachments

 \<%= render :partial=\>'service\_desk\_part/edit\_sd\_details' %\> 

 \<%= render :partial =\> 'service\_desk\_part/view\_sd\_resolution\_details' %\> 

 \<%= render :partial =\> 'service\_desk\_part/view\_sd\_attachment\_details'%\> 
\<% activeTabNo=(params[:activeTab].nil?)?0:params[:activeTab]%\>

So here always first tab highlighted.Now i am calling an ajax function  
link\_to\_remote from bottom of the file and before that takes place I  
have to activate the second tab( ie tab for Resolutions) .How can i do  
this?I tried with :before with link\_to\_remote .But how?I have a  
javascript function for expanding the tab  
expandtab(“sd\_ticket\_view\_main\_tab”, \<%= activeTabNo %\>)…But for that I  
have to reload the page…How can I do without reloading the page  
after(before) this ajax call ?

Sijo
