Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to skip prepend_before_action in Rails 4 and Devise?

I want to enforce authentication to Devise registration controller's new and create function because I am implementing a custom sign_up mechanism that requires an admin to sign in first.

But Devise is forcing require_no_authentication on new and create with prepend_before_action.

According to Rails, I can skip_before_action, however,

how do I force skipping prepend_before_action?

like image 717
donkey Avatar asked Sep 08 '25 04:09

donkey


1 Answers

Doesn't skip_before_action work for you? A before_action is just an alias for append_before_action and I think it does not matter whether the callback is appended or prepended to the list of callbacks to be allowed to be skipped with skip_before_action.

like image 100
Matouš Borák Avatar answered Sep 09 '25 23:09

Matouš Borák