Topic: A better way to do this? (select field)
Right now I have it so this following code can let me specify a category:
<% @categories.each do |category| %>
<option value="<%= category.id %>">
<%= category.title %>
<% end %>
First, I don't think this looks pretty enough for rails.
Second, it has a problem. If I update a field (for instance, making something approved) and then click edit. The category is default on the first field, so any time I update it's going to switch the category to the first category in the drop down, instead of defaulting to the category that is already set.
How would I implement that functionality so it defaults to the category if one is already set?