ruby-on-railsrubyactionactiveadmincustom-pages

active admin: open a custom page after clicking on an action_item link


I have resource called "section".In edit page of section i have a action item called "upload scores".On click on "upload scores" i want to open a new page which should get the section id as parameter.

action_item only: :edit do
  link_to 'Upload Scores' {:id => section }
end

This page should contain a form with a "upload xls sheet" button and submit button.On click on "upload xls sheet" button I should be able to upload the sheet.on "submit" i should read it and update the database.

Thanks in Advance


Solution

  • action_item only: :edit do
      link_to 'Upload Scores', upload_score_path(id: section)
    end
    

    change upload_score_path with your routes