Update layout.erb

Added a submitted variable in a closure to prevent duplicate submissions.