How to override "create" method from Vise?

Asked

Viewed 106 times

2

Hello,

I need to overwrite the "create" method from Windows to make a certain logic before saving the user. However I do not know the path of the stones to make such a change. I already googled but the examples were not clear to me.

I generated the controllers for the "User" model created by the device via the command rails g devise:controllers users. And I thought about overwriting the "create" method generated in this controller, and at that point I stopped!

Kindly post the path I must follow ?

1 answer

1

Hello,

In his RegistrationsController extending from Devise::RegistrationsController the envelope of create may be the following:

def create
  super 
  #sua lógica
  resource.save
end

I hope it helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.