mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-10 08:08:00 -05:00
25 lines
606 B
Ruby
25 lines
606 B
Ruby
module Devise
|
|
module Controllers
|
|
# Common actions shared between Devise controllers
|
|
module Common #:nodoc:
|
|
# GET /resource/controller/new
|
|
def new
|
|
build_resource
|
|
render_with_scope :new
|
|
end
|
|
|
|
# POST /resource/controller
|
|
def create
|
|
self.resource = resource_class.send(send_instructions_with, params[resource_name])
|
|
|
|
if resource.errors.empty?
|
|
set_flash_message :notice, :send_instructions
|
|
redirect_to new_session_path(resource_name)
|
|
else
|
|
render_with_scope :new
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|