Rails does away with this complexity by providing view helpers for generating form markup. For example the following makes the current user and logged in. You can customize the format in the options hash.