# Concat, nil.\<\< and Rails 2.3.0RC1

**URL:** <https://www.ruby-forum.com/t/concat-nil-and-rails-2-3-0rc1/159437>\
**Category:** Rails\
**Created:** [February 4, 2009, 3:37pm UTC](https://www.ruby-forum.com/t/concat-nil-and-rails-2-3-0rc1/159437 "2009-02-04T15:37:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6de8d8/32.png) [@joost](https://www.ruby-forum.com/u/joost)\
**Post date:** [February 4, 2009, 3:37pm UTC](https://www.ruby-forum.com/t/concat-nil-and-rails-2-3-0rc1/159437/1 "2009-02-04T15:37:32Z")

</div>

When moving to Rails 2.3.0RC1 I get an error with concat!? I can’t  
figure it out. See the dump below:

ActionView::TemplateError (You have a nil object when you didn’t  
expect  
it!  
You might have expected an instance of Array.  
The error occurred while evaluating nil.\<\<) on line #158 of  
app/views/places/show.html.erb:  
158:

  
159: 
### \<%= “What do you think about ‘%s’?” / @place %\>
  
160: \<% end -%\>  
161: \<% form\_for([@place, @review = Review.new]) do |f| %\>

```
actionpack (2.3.0) lib/action_view/helpers/text_helper.rb:32:in

```

`concat' actionpack (2.3.0) lib/action_view/helpers/form_helper.rb:252:in`form\_for’  
app/views/places/show.html.erb:158

It seems to be something with form\_for and blocks or something?! It  
does  
NOT appear in Rails 2.2.2 however :S

Any help is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![joost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6de8d8/32.png) [@joost](https://www.ruby-forum.com/u/joost)\
**Post date:** [February 4, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/concat-nil-and-rails-2-3-0rc1/159437/2 "2009-02-04T17:00:28Z")

</div>

On Feb 4, 2009, at 7:31 AM, Joost wrote:

> 158:
> 
>   
> 159: 
> ### \<%= “What do you think about ‘%s’?” / @place %\>

What’s this supposed to be? Is that / supposed to be % (for String#%)?

> It seems to be something with form\_for and blocks or something?! It  
> does  
> NOT appear in Rails 2.2.2 however :S
> 
> Any help is greatly appreciated!
> 
> >

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![joost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6de8d8/32.png) [@joost](https://www.ruby-forum.com/u/joost)\
**Post date:** [February 4, 2009, 6:33pm UTC](https://www.ruby-forum.com/t/concat-nil-and-rails-2-3-0rc1/159437/3 "2009-02-04T18:33:53Z")

</div>

Hmm… might be something that / …  
It comes from deprecated Globalize (v1) that uses the “blabla %s  
blabla” / ‘something’ to translate strings…

Any other ideas?

---

<div class="post-metadata">

**Author:** ![joost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6de8d8/32.png) [@joost](https://www.ruby-forum.com/u/joost)\
**Post date:** [February 4, 2009, 7:08pm UTC](https://www.ruby-forum.com/t/concat-nil-and-rails-2-3-0rc1/159437/4 "2009-02-04T19:08:01Z")

</div>

On Feb 4, 2009, at 12:33 PM, Joost wrote:

> Hmm… might be something that / …  
> It comes from deprecated Globalize (v1) that uses the “blabla %s  
> blabla” / ‘something’ to translate strings…
> 
> Any other ideas?

OK, so Globalize defines a String#/ is it possible that it is not  
finding a translation for the “blabla” and thus using a nil internally?

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![joost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6de8d8/32.png) [@joost](https://www.ruby-forum.com/u/joost)\
**Post date:** [February 5, 2009, 9:57am UTC](https://www.ruby-forum.com/t/concat-nil-and-rails-2-3-0rc1/159437/5 "2009-02-05T09:57:58Z")

</div>

I’ve overwritten the method to NOT return nil in any case. However the  
error seems not to be in those calls. It’s more in blocks or  
something. See below:

Showing app/views/layouts/\_header.html.erb where line #4 raised:

You have a nil object when you didn’t expect it!  
You might have expected an instance of Array.  
The error occurred while evaluating nil.\<\<

Extracted source (around line #4):

1:

  
2: 

  
3: 
  
4: \<% form\_tag(search\_places\_path, :method =\> :get) do -%\>  
5: \<% with\_options(:scope =\> [:form, :search\_place]) do |i| -%\>  
6: 
  
7: 

Trace of template inclusion: app/views/layouts/site.html.erb

RAILS\_ROOT: /Users/joost/Workspace/project  
Application Trace | Framework Trace | Full Trace

/Users/joost/.gem/ruby/1.8/gems/actionpack-2.3.0/lib/action\_view/  
helpers/text\_helper.rb:32:in `concat' /Users/joost/.gem/ruby/1.8/gems/actionpack-2.3.0/lib/action_view/ helpers/form_tag_helper.rb:461:in`form\_tag\_in\_block’  
/Users/joost/.gem/ruby/1.8/gems/actionpack-2.3.0/lib/action\_view/  
helpers/form\_tag\_helper.rb:39:in `form\_tag’

---

<div class="post-metadata">

**Author:** ![joost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6de8d8/32.png) [@joost](https://www.ruby-forum.com/u/joost)\
**Post date:** [February 5, 2009, 10:18am UTC](https://www.ruby-forum.com/t/concat-nil-and-rails-2-3-0rc1/159437/6 "2009-02-05T10:18:29Z")

</div>

I found it… it was Erubis that doesn’t work with Rails 2.2 and 2.3.
