ruby on rails - Pass block to registrations controller, devise_token_auth syntax? -


i have user , admin classes, have associated profile polymorphic has_one. i've found example vanilla devise build profile in new method user class, if try override method nothing happens.

in the devise token auth documentation says can pass block controller want extend , block run after controller performs standard function. example looks this:

class custom::registrationscontroller < devisetokenauth::registrationscontroller    def create     super |resource|       resource.do_something(extra)     end   end  end 

i need sorting out syntax of looks like. need call build_profile in create method, can't happen no matter put in block. if run outside block runs when registrations controller called (and can see controller getting called in logs.)

so, how call build_profile in block passed super, question.


Comments

Popular posts from this blog

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -