ruby on rails - Devise: Overriding create action in Registrations Controller for Recaptcha -
i'm trying override create method registrations controller in devise include recaptcha verification (as seen here , here):
class registrationscontroller < devise::registrationscontroller def create if verify_recaptcha super else build_resource clean_up_passwords(resource) flash[:alert] = "bad words." render_with_scope :new end end end
also changed routes.rb accordingly:
map.devise_for :users, :controllers => {:registrations => "registrations"}, :path_names => { :sign_up => 'signup', :sign_in => 'login', :sign_out => 'logout' }
when trying visit new registration page (with new path name: http://localhost:3000/users/signup) errors shows up:
loaderror in registrationscontroller#new expected /home/benoror/project/app/controllers/registrations_controller.rb define registrationscontroller
any appreciated.
btw, i'm using devise 1.0.11 , rails 2.3.10, thanks!
is controller in users module? if so, need
class users::registrationscontroller,
{:registrations => "users/registrations"}
edit: according josé valim, custom controllers don't work prior devise 1.1. no reason developing on < rails 3 imho. sorry missed in original post.
Comments
Post a Comment