Forum: Ruby on Rails concat, nil.<< and Rails 2.3.0RC1

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joost (Guest)
on 2009-02-04 16:37
(Received via mailing list)
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:         <div class="dottedSeparator"></div>
159:         <h3><%= "What do you think about '%s'?" / @place %></h3>
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!
Rob B. (Guest)
on 2009-02-04 18:00
(Received via mailing list)
On Feb 4, 2009, at 7:31 AM, Joost wrote:

> 158:         <div class="dottedSeparator"></div>
> 159:         <h3><%= "What do you think about '%s'?" / @place %></h3>

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
removed_email_address@domain.invalid
Joost (Guest)
on 2009-02-04 19:33
(Received via mailing list)
Hmm.. might be something that / ..
It comes from deprecated Globalize (v1) that uses the "blabla %s
blabla" / 'something' to translate strings..

Any other ideas?
Rob B. (Guest)
on 2009-02-04 20:08
(Received via mailing list)
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
removed_email_address@domain.invalid
Joost (Guest)
on 2009-02-05 10:57
(Received via mailing list)
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: <div id="innerHeader">
2:   <div id="innerLogo"></div>
3:   <div id="search" class="overflow">
4:     <% form_tag(search_places_path, :method => :get) do -%>
5:     <% with_options(:scope => [:form, :search_place]) do |i| -%>
6:       <div class="left">
7:         <div class="left halfMarginRight">

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'
Joost (Guest)
on 2009-02-05 11:18
(Received via mailing list)
I found it.. it was Erubis that doesn't work with Rails 2.2 and 2.3.
This topic is locked and can not be replied to.