私は新しいレールエンジンを持っており、globalize3を使いたいと思います。私は自分のlib // engine.rbでこれをやった:未定義のメソッド `create_translation_table! '
require 'globalize3'
module SimpleCms
class Engine < ::Rails::Engine
end
end
さて、私はこのような移行を作成してみてください:
class CreatePages < ActiveRecord::Migration
def up
create_table :pages do |t|
t.string :path
t.timestamps
end
Page.create_translation_table! title: :string, body: :body
end
def down
drop_table :pages
Page.drop_translation_table!
end
end
をそして、私はこのエラーを持っている:
undefined method `create_translation_table!' for #<Class:0x00000001d5ca18>
私はファイル 'lib/globalize/active_record/migration.rb'がロードされていないと思う。
に戻ってそれを変更する。これは私をたくさん助けました!最後に、これは欠けている作品だった。 – Vinozio
ありがとうMuntasim –
ニースショット:)それは私の問題を修正:) – user1713964