これは単なるコードブロックにViewLoggerのための右の名前に置き換えて、私のために働いていたものです非常識な私を駆動するので、私は本当にすべてのアイデアを感謝しています。この方法では、データベースにダミーのテーブルを作成する必要はありません。
この内容のファイルを/app/models/viewlogger.rbにして、より高度なテーブルレスモデルの場合は、http://keithmcdonnell.net/activerecord_tableless_model_gem.htmlをチェックアウトするか、独自の洞察をGoogleでチェックしてください。
class Viewlogger < ActiveRecord::Base
def self.columns
@columns ||= []
end
# ...
end
のconfig/routes.rbをして、あなたのviewloggerのためのルートを設定
ActiveSupport::Inflector.inflections do |inflect|
inflect.uncountable %w(viewlogger)
end
を/config/initializers/inflections.rbにエントリを追加します。
match '/admin/viewlogger' => 'admin/viewlogger#index', :as => :admin_viewlogger
今次のようにactiveadminレジスタブロックを定式化することができます(適切な場所にビューの一部を作成してください)
ActiveAdmin.register Viewlogger do
config.comments = false
before_filter do @skip_sidebar = true end
# menu false
config.clear_action_items! # this will prevent the 'new button' showing up
controller do
def index
# some hopefully useful code
render 'admin/viewlogger/index', :layout => 'active_admin'
end
end
エンド
これは、 {:action => "show"、:controller => "admin/crime_maps"}必要なキーがありません:[:id] ' – m02ph3u5