snippets and rails stuff