Please help - I have couple of doubts

I have a somewhat similar situation in which I have a list of "headers". For example's sake, lets call it a list of people and the header includes a name and a date of birth. When the header is clicked, I display a form that is populated with details about the person. I do this with a variation of link_to_remote. Basically, you make an AJAX call to the server passing the id of the object you want to operate on. The controller action then gathers all the data necessary and renders a partial, which is displayed in the area you want it. If you use link_to_remote "properly", then one of the parameters is :update => "dom_id_of_element_to_update" and all you have to do in the controller is a render :partial. I, however, being the renegade (or idiot, as the case may be) that I am, call a Javascript function which makes the AJAX call and the controller uses render :update to refresh the element. [Ooh, I can hear all the boos now. :)]

That should get you going. If not, feel free to ask more.

Peace, Phillip

Well, you can do basically the same thing with link_to as you do with redirect_to, and that is

<%= link_to "My link", :controller => 'my_controller', :action => 'my_action', :id => 1, :my_param_1 => 'good-bye', :my_param_2 => 'cruel world!' %>

and that will result in a url like

http://localhost:3000/my_controller/my_action/1?my_param_1=good-bye&my_param_2=cruel+world!

If you don't like fat URLs, the other option is to use :method => :post, which I *think* you can do with link_to. I'll leave figuring that part out to you :slight_smile:

Peace, Phillip