简体   繁体   中英

Rails active admin implement my action

I need to introduce to my method some action (not as in activeadmin gem like view,edit etc), but my own, like upload file and do something in controller method, but how to do this, also i need link in activeadmin like "mymethod". Are any ideas?

Can you try writing,

 controller do 

  def method_name
  //some stuff
  end

 end

in your active admin resource file in app/admin/some_resource_name.rb

如果您想为active_admin添加控制器操作,请检出https://github.com/gregbell/active_admin/wiki/Add-custom-actions-and-buttons

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM