Before the migration, the website was totally ok. Now we have migrated to a new server and the website started showing these kind of error for some links: http://babybum.proj.dev.doo.is/sao-paulo/planta
This is the definition of “area” in fair-controller
def area
@area_name = BB_MENU_AREAS_SLUG.select {|k, v| v == params[:area]}.keys.first
if @area_name
@area = Snippet.find_by_identifier([params[:fair_location], @area_name.to_s].join('-'))
else
redirect_to root_path
end
end
The snippet of BB_AREAS_SLUG
BB_AREAS = {
:about => {:link => "quem somos", :slug => "quem-somos"},
:expositors => {:link => "expositores",:slug => "expositores"},
:map => {:link => "planta", :slug => "planta"},
:activities => {:link => "atividades",:slug => "atividades"},
:address => {:link => "como chegar",:slug => "como-chegar"},
:support => {:link => "apoio", :slug => "apoio"},
:optin => {:link => "cadastro",:slug => "cadastro"},
:how_expositors => {:link => "como expor",:slug => "como-expor"},
:press => {:link => "imprensa",:slug => "imprensa"},
:contact => {:link => "contato",:slug => "contato"},
}
BB_MENU_AREAS = BB_AREAS.each_with_object({}) { |(k, v), h| h[k] = v[:link]}
BB_MENU_AREAS_SLUG = BB_AREAS.each_with_object({}) { |(k, v), h| h[k] = v[:slug]}
Could someone help me?
Thank you
Propably the problem is another Ruby version. I don’t have 1.8 to test it, but propably on old server you have 1.8.x and now is 1.9.x. You need to change
to
or even refractor it to: