lib/janus/controllers/confirmations_controller.rb in janus-0.6.0 vs lib/janus/controllers/confirmations_controller.rb in janus-0.7.0
- old
+ new
@@ -5,14 +5,14 @@
helper JanusHelper
def show
self.resource = resource_class.find_for_confirmation(params[resource_class.confirmation_key])
-
+
if resource
resource.confirm!
-
+
respond_to do |format|
format.html { redirect_to root_url, :notice => t('flash.janus.confirmations.edit.confirmed') }
format.any { head :ok }
end
else
@@ -20,11 +20,11 @@
format.html do
self.resource = resource_class.new
resource.errors.add(:base, :invalid_token)
render 'new'
end
-
+
format.any { head :bad_request }
end
end
end
@@ -33,14 +33,14 @@
respond_with(resource)
end
def create
self.resource = resource_class.find_for_database_authentication(params[resource_name])
-
+
if resource
JanusMailer.confirmation_instructions(resource).deliver
-
+
respond_to do |format|
format.html { redirect_to root_url, :notice => t('flash.janus.confirmations.create.email_sent') }
format.any { head :ok }
end
else
@@ -48,10 +48,10 @@
format.html do
self.resource = resource_class.new
resource.errors.add(:base, :not_found)
render 'new'
end
-
+
format.any { head :not_found }
end
end
end
end