# How do I pass data from index page back to index page?

**URL:** <https://www.ruby-forum.com/t/how-do-i-pass-data-from-index-page-back-to-index-page/131373>\
**Category:** Rails\
**Created:** [March 8, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/how-do-i-pass-data-from-index-page-back-to-index-page/131373 "2008-03-08T23:17:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![capslock118](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/df705f/32.png) [@capslock118](https://www.ruby-forum.com/u/capslock118)\
**Post date:** [March 8, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/how-do-i-pass-data-from-index-page-back-to-index-page/131373/1 "2008-03-08T23:17:19Z")

</div>

Hello,

I currently have this in my view:  
\<%= link\_to h(sub\_category.name), :controller =\> ‘categories’, :action  
=\> ‘show’, :id =\> sub\_category.id %\>

however I do not want to go to the categories controller. I would much  
rather go back to public controller/view/layout (my index page) and  
display the information there.

So I am a bit lost being new to rails as to how to pass parameters in  
order to call any data the user is asking for.

For instance, if someone clicks on a category - display in the main  
column of the page the content for that category - if they click on a  
sub category - display content for that and so on.

I was thinking I would need to do this in the view (actually its a  
partial):  
\<%= link\_to h(sub\_category.name), :controller =\> ‘public’, :action =\>  
‘show’, :id =\> sub\_category.id %\>

and then in the public controller do  
def show  
I am not sure what to put here in order to make is universal to all  
data.  
end
