I like using one-liners in cases like this, what do you think?

```ruby
context[:layout] = assigns[:layout].attributes if assigns.has_key?(:layout)
```