【发布时间】:2015-05-25 16:09:32
【问题描述】:
我收到此错误: 耙中止! Page::Translation:0x0000000548d5f0 的未定义方法“meta_keywords”
在炼油厂 cms 1.0.0 rails 3.0.7 上运行 rake db:setup 时。
并且不能完全调试它
编辑 架构的一部分:
create_table "page_part_translations", :force => true do |t|
t.integer "page_part_id"
t.string "locale"
t.text "body"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "page_part_translations", ["page_part_id"], :name => "index_page_part_translations_on_page_part_id"
create_table "page_parts", :force => true do |t|
t.integer "page_id"
t.string "title"
t.text "body"
t.integer "position"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "page_parts", ["id"], :name => "index_page_parts_on_id"
add_index "page_parts", ["page_id"], :name => "index_page_parts_on_page_id"
create_table "page_translations", :force => true do |t|
t.integer "page_id"
t.string "locale"
t.string "title"
t.string "custom_title"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "page_translations", ["page_id"], :name => "index_page_translations_on_page_id"
create_table "pages", :force => true do |t|
t.integer "parent_id"
t.integer "position"
t.string "path"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "show_in_menu", :default => true
t.string "link_url"
t.string "menu_match"
t.boolean "deletable", :default => true
t.string "custom_title_type", :default => "none"
t.boolean "draft", :default => false
t.boolean "skip_to_first_child", :default => false
t.integer "lft"
t.integer "rgt"
t.integer "depth"
end
add_index "pages", ["depth"], :name => "index_pages_on_depth"
add_index "pages", ["id"], :name => "index_pages_on_id"
add_index "pages", ["lft"], :name => "index_pages_on_lft"
add_index "pages", ["parent_id"], :name => "index_pages_on_parent_id"
add_index "pages", ["rgt"], :name => "index_pages_on_rgt"
pages.rb: https://gist.github.com/grzegorzhauska/dcca44f3e2091c21400a pages_for_inqueries.rb: https://gist.github.com/grzegorzhauska/997c355c2ce09d1da624
【问题讨论】:
-
发布您的 schema.rb 和 seed.rb(只是包含字符串 'meta_keywords' 的相关部分。" 其中一个文件可能有像 'page.meta_keywords' 这样的印刷错误。
-
我认为您不太了解您要查找的内容...我根据错误告诉您正在调用某些 meta_keywords 方法这一事实询问了这些文件的相关部分在 Page 对象上。 Page 没有 meta_keywords 方法——它可能是由于印刷错误而被调用的。在文件中查找字符串“meta_keywords”(它可能不在这些文件中,因为错误可能是由验证或过滤器或其他东西产生的)。
-
是的,你是对的。我只是在学习rails :)。这很奇怪,但错误刚刚消失。
-
我应该关闭这个问题吗?
标签: ruby-on-rails rake refinerycms