Page_header error

One of my posts just all of a sudden started giving me a Rails
Application error when I try to view it through its permalink. I get
the following error.

Processing Base#permalink (for 192.168.15.101 at 2006-11-24 09:13:25)
[GET]
Parameters: {“month”=>“10”, “title”=>“google-sitemaps-with-typo”,
“action”=>“permalink”, “controller”=>“articles”, “day”=>“13”,
“year”=>“2006”}

ActionView::TemplateError (private method `select’ called for
0:Fixnum) on line #6 of themes/razure/layouts/default.rhtml:
3:
4: <%=h page_title %>
5:
6: <%= page_header %>
7: <%= stylesheet_link_tag “/stylesheets/theme/razure”, :media =>
‘all’ %>
8: <%= stylesheet_link_tag “/stylesheets/theme/local”, :media => ‘all’
%>
9:

The weird thing is that it has nothing to do with the theme I am
using. I have tried three different themes all with the same result.
It was working fine up until I edited the article then resaved it.

Any suggestions?

-Steve
http://youdummy.net/blog

the problem seems to lie in app/helps/article_helper.rb. Can someone
tell me what line #54 is doing.

page_header_includes = contents.collect { |c| c.whiteboard }.collect {
|w| w.select {|k,v| k =~ /^page_header_/}.collect {|(k,v)| v}
}.flatten.uniq

If I comment this out everything seems to work fine.

Thanks,
-Steve
http://youdummy.net/blog

“Steve Lenti” [email protected] writes:

One of my posts just all of a sudden started giving me a Rails

Just one post? That was working fine before? And you’ve made no
changes to either typo or your rails installation?

3:
4: <%=h page_title %>
5:
6: <%= page_header %>
7: <%= stylesheet_link_tag “/stylesheets/theme/razure”, :media => ‘all’ %>
8: <%= stylesheet_link_tag “/stylesheets/theme/local”, :media => ‘all’ %>
9:

The weird thing is that it has nothing to do with the theme I am
using. I have tried three different themes all with the same result.
It was working fine up until I edited the article then resaved it.

Hmm… I can’t seem to replicate this. Can you try running

$ RAILS_ENV=production ./script/console

from your rails root directory. Then

a = Article.find()

You can find out the dodgy article’s id by looking at it on the
admin/content page. The article’s URL will be /admin/content/show/

Once you’ve got that, do:

a.whiteboard

And let us know the results. If the answer is ‘nil’, do

a.html(:all); nil
a.whiteboard

and mail back with that result.

“Steve Lenti” [email protected] writes:

the problem seems to lie in app/helps/article_helper.rb. Can someone
tell me what line #54 is doing.

page_header_includes = contents.collect { |c| c.whiteboard }.collect {
|w| w.select {|k,v| k =~ /^page_header_/}.collect {|(k,v)| v}
}.flatten.uniq

If I comment this out everything seems to work fine.

What? You can’t tell?

It could be a good deal neater couldn’t it, but it shouldn’t really be
failing. I shall tidy it up as soon as I’ve finished writing this.

What database backend are you using? Sqlite by any chance?

On 11/24/06, Piers C. [email protected] wrote:

What? You can’t tell?

It could be a good deal neater couldn’t it, but it shouldn’t really be
failing. I shall tidy it up as soon as I’ve finished writing this.

What database backend are you using? Sqlite by any chance?

Actually the changes I have made is what is probably causing the
problem. I recently migrated to MySQL from SQLite using my homemade
script. So I figure that is probably what initially caused the
problem. The whiteboard on the screwed up post is set to “0”. All
the new posts since migration are set to NULL and all the previous are
set to “”. Setting the problem article to NULL has seemed to solve
the problem.

Thanks for the advice.
-Steve
http://youdummy.net/blog

“Steve Lenti” [email protected] writes:

If I comment this out everything seems to work fine.
problem. I recently migrated to MySQL from SQLite using my homemade
script. So I figure that is probably what initially caused the
problem. The whiteboard on the screwed up post is set to “0”. All
the new posts since migration are set to NULL and all the previous are
set to “”. Setting the problem article to NULL has seemed to solve
the problem.

Ladeez and gentlemen, we have a winner. Now we just have to work out
what’s up with the installation that’s dying on TextDrive and we’re
halfway to being delighted.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs