简体   繁体   中英

In Active Admin Gem,how to modify the view of resource?

I have implemented ActiveAdmin in my Rails project. I have a resource called "Customer". In the navigation bar, there is an option called "New Customer" to create a customer. How can I change the view of this new customer? When I click "New Customer" button, it has to accept email from me, and it should send an invitation to that email-id.

All you need to do is follow this

https://gist.github.com/mikeatlas/5628317

it has enough details to setup devise_invitable with active_admin .

Actually we can do it by, integrating ActiveAdmin and DeviseInvitable Gems. The following link illustrates that.

Here's a link !, In which they have explained neatly.

If your Customer model has a email field, then you can just allow only the email to be shown in the form, and override the 'create' method. Something like this:

form do |f|
  f.input :email

  f.actions
end

def create
  #send the email here 
end

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