Question

Im using active admin gem.

My doubt is can i create a new column in another table, while updating a table using active admin gem.

If possible show me some tutorials..

Like im in user.rb model.. and im editing it via active admin.. I have entered a name and while saving i want this name to get saved in another model too.at the same time.

Était-ce utile?

La solution

Please try like this:

controller do
 def create
   create! # this will do default operations
   # Do your stuff here
 end
end

In active admin internally they are using inherited resources.

or try like

ActiveAdmin.register User do
  after_create do |user|
  product.creator = user.name
 end
end
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top