How to implement data ordering and importing/exporting?

Here's the situation in the context of shovell application

Let's say we need to add new stories. To make it more effective we could use importing.
The stories:
zip The story teller,
zip The fantastic adventure,
zip Summer holidays,
zip Space travel,

The reverse would be nice too (exporting).

Next: it would be good to sort the data.
Much like fetch_stories method in stories_controller.rb. How to display stories that start with "zip". I know how I would do that in PHP. I would make SQL statement "select * from stories where name like 'zip%'". And of course HTML select tag to select stories where the link is for a particular domain like "" (this would be the sort by unique value filter).
Then the other: ordering. A link over columns to order data ascending or descending. Should the direction be stored in session hash?

It seems like a basic thing but it's not. I don't know how to operate forms in rails well enough as I do in PHP.

Thanks in advance!