I am new to rails and have a question
about I understand the examples that have a select drop
down selections which map to a column in the model’s database row. What
I want to do is provide a drop down list for selections which do not map
to a single column in a row but which maps to any one of the columns in the

The list would be defined in the model class, named say Book:
SORT_TYPES = [[“id”, “id”],
[“price”, “price”]
[“color”, “color”]]

The form would look something like:
<% form_for :book, :url => { :action => :sort } do |form| %>
<%= :sort_type,
:prompt => “sort reviews by”
<%= submit_tag “Sort”, :class => “submit” %>
<% end %>

the form is submitted, the sort method of the Book_controller is called
and I want to trap the value the user chose from the drop down list of
options, each of which is a column in the books table. I know the sort
method is called but I can’t seem to get a value from the selection.

So the question is: How do I trap a value from a which is not mapped to a single column from a model’s table but to one of the table’s columns? How about the select return any arbitrary value (one not associated with a database table)?

Any help would be greatly appreciated.

Thanks for your time,
Dave Hackenyos