Revised the Rails snippets according to Ruby code styles.