1

Does anyone know how to add helpers to the dashboard? I've added a filter to the dashboard, but will need to get the filter params from the URL. Instead of repeating code to strip the url for the params, I'd like to send it to a method to have it parse the URL, then send those variables back to each section.

Current code

section do
  div :id =>"dashboardText" do
    range=params()
    fromDate=range[:fromDate].to_i
    toDate=range[:toDate].to_i
    fromDate = (fromDate>0) ? fromDate: nil || 30
    toDate = (toDate==0) ? -1: toDate || -1
    table do

I've tried placing the method in the Application helper and including it, as well as in the application controller itself. Does anyone have any work arounds for the Dashboard?

LyricalPanda
  • 1,424
  • 14
  • 25
  • Check out this answer which describes adding methods to AcitveAdmin::ViewsHelper. http://stackoverflow.com/a/9161997/302824 – Charles Maresh Feb 19 '13 at 23:11
  • Possible duplicate of [Rails 3. How to add a helper that ActiveAdmin will use?](https://stackoverflow.com/questions/8673112/rails-3-how-to-add-a-helper-that-activeadmin-will-use) – Peter DeWeese Jun 08 '18 at 15:56

0 Answers0