「@Answers = Assens.all」などのコントローラーロジックを渡す、アクティブな管理者部分へ

StackOverflow https://stackoverflow.com/questions/8301241

質問

Active Admin用のDashboards.RBファイルでこの部分を作成しました。 /adminのダッシュボードセクションでそのデータをレンダリングできるように、変数を部分的に渡す必要があります。コントローラーに方程式を作成するか、部分的なものがそれに到達できる場所で式を作成し、それらを部分的なものに渡す必要があります。アクティブな管理者のどこでそれをすることができますか?

# == Render Partial Section
  # The block is rendered within the context of the view, so you can
  # easily render a partial rather than build content in ruby.
  #
    section "Month One Statistics" do
      div do
        render 'recent_graphs' # => this will render /app/views/admin/dashboard/_recent_posts.html.erb
       end
     end
役に立ちましたか?

解決

wikiを試してみてください、それは良い説明を持っています、そして他と同様に グッズ ここ:

https://github.com/gregbell/active_admin/wiki/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top