I'm new to rails, and right now I've got a simple application with a controller and view. The page loads up and the controller does a ton of http requests (can't change this) and populates an array of structs. The controller sorts it and the view iterates through and displays it in a table.
I would like the user to be able to click one of several buttons and sort the data in different ways. Right now, I simply pass a :sort variable with a page reload, sort a different way and voila. But, I was wondering if there was a way to sort this array without having to repopulate it. This might be a super simple question and I'm just not searching for the right thing. Basically, can I pass the array back to the controller so it can sort and reload the page? Thanks for any help.