Tag: templates

  • Hashes for select

    In Ruby on Rails there’s a very easy way to create a select tag: form.select(“period”, [[“Month”, 1], [“Year”, 12]]) In my case I have the options in a hash, like: periods = { 1 => “Month”, 12 => “Year” } but when I did this: form.select(“period”, periods) I was surprised to find out that the…