Tag: tag

  • 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 […]

  • Closing tag in XML

    I always wondered why they didn’t allow an optional closing tag of “</>” that would close the corresponding open tag. For example: <p>This is a string with something <b>bold</> in it.</p> where “</>” is closing the <b> tag. Or: <blah><bleh><blih><bloh>bluh</></></></> which is shorter than: <blah><bleh><blih><bloh>bluh</bloh></blih></bleh></blah> I fell it is a shortcut like the stand-alone tag […]