Improving Rails controller snippets