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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
All you need to do is follow this
https://gist.github.com/mikeatlas/5628317
it has enough information to setup devise_invitable
with active_admin
hope this will solve your problem, which u are facing in your second question
In ActiveAdmin Gem, how to add invitation count to Admin model?
回答2:
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.
回答3:
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