Question: I have an array with keys that I use to create options for a drop down

```
FEEDBACK_NOTIFICATION = [['Only in reports', 'only_in_reports'],['Immediately', 'immediately']]

<%= f.select(:feedback_schedule, options_for_select(FEEDBACK_NOTIFICATION)) %>

```

The first values ('Only in reports', 'Immediately') are displayed in the drop down but the last value is stored in the database ('only\_in\_reports' or 'immediately').

When I want to show the value in a view I am doing something like this:

```
REPORT_SCHEDULE.select {|v,k| k==@company.report_schedule}.first.first

```

Is there not an easier way to retrieve a value from a key pair array?

Answer: 
Slightly better:

```
REPORT_SCHEDULE.find { |v, k| k == @company.report_schedule }.first

```

Personally, I would however store the "translations" in a yaml file, following the I18n conventions, as shown in my answer on question [Translating activerecord collection for a dropdown](https://stackoverflow.com/questions/22193047/translating-activerecord-collection-for-a-dropdown/22193837#22193837)

This way, your "representation" is nicely separated from the rest of your code
This should do.

```
Hash[REPORT_SCHEDULE][@company.report_schedule]

```