app/controllers/devise/invitations_controller.rb in devise_invitable-0.6.1 vs app/controllers/devise/invitations_controller.rb in devise_invitable-1.0.0
- old
+ new
@@ -1,35 +1,34 @@
-class Devise::InvitationsController < ApplicationController
- include Devise::Controllers::InternalHelpers
+class Devise::InvitationsController < DeviseController
before_filter :authenticate_inviter!, :only => [:new, :create]
before_filter :has_invitations_left?, :only => [:create]
before_filter :require_no_authentication, :only => [:edit, :update]
helper_method :after_sign_in_path_for
# GET /resource/invitation/new
def new
build_resource
- render_with_scope :new
+ render :new
end
# POST /resource/invitation
def create
self.resource = resource_class.invite!(params[resource_name], current_inviter)
if resource.errors.empty?
set_flash_message :notice, :send_instructions, :email => self.resource.email
respond_with resource, :location => after_invite_path_for(resource)
else
- respond_with_navigational(resource) { render_with_scope :new }
+ respond_with_navigational(resource) { render :new }
end
end
# GET /resource/invitation/accept?invitation_token=abcdef
def edit
if params[:invitation_token] && self.resource = resource_class.to_adapter.find_first( :invitation_token => params[:invitation_token] )
- render_with_scope :edit
+ render :edit
else
set_flash_message(:alert, :invitation_token_invalid)
redirect_to after_sign_out_path_for(resource_name)
end
end
@@ -41,11 +40,11 @@
if resource.errors.empty?
set_flash_message :notice, :updated
sign_in(resource_name, resource)
respond_with resource, :location => after_accept_path_for(resource)
else
- respond_with_navigational(resource){ render_with_scope :edit }
+ respond_with_navigational(resource){ render :edit }
end
end
protected
def current_inviter
@@ -54,10 +53,10 @@
def has_invitations_left?
unless current_inviter.nil? || current_inviter.has_invitations_left?
build_resource
set_flash_message :alert, :no_invitations_remaining
- respond_with_navigational(resource) { render_with_scope :new }
+ respond_with_navigational(resource) { render :new }
end
end
def after_invite_path_for(resource)
after_sign_in_path_for(resource)