maybe
```ruby
name = associated_resource.name.to_s
```
and remove name.to_s on following lines