title: Rails model constants with hash
body: <p>I have added some constants to a model say <code>MyModel.rb</code> as shown below.</p>
  
  <pre><code>MY_CONST = {
    :foo =&gt;"Some Name for Foo",
    :bar =&gt;"Some Name for Bar"
    }
  </code></pre>
  
  <p>Also I have saved string <code>foo</code> as the column value in a table record.</p>
  
  <pre><code>@m = MyModel.find(1)
  @m.column_name #=&gt; foo
  </code></pre>
  
  <p>Now in my view I need to show "Some Name for Foo" as the output for <code>@m.column_name</code> instead of <code>foo</code></p>
  
  <p>I tried <code>MyModel::MY_CONST[:foo]</code> and it prints <code>"Some Name for Foo"</code> as the output. But I don't know how to pass <code>@m.column_name</code> to <code>MyModel::MY_CONST[....]</code> dynamically.  </p>