aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/new_controller.rb
diff options
context:
space:
mode:
authorfrancis <francis>2007-10-10 16:06:16 +0000
committerfrancis <francis>2007-10-10 16:06:16 +0000
commit6ed305b3c64f3fd90c970d54ea91d4a913967c47 (patch)
tree678e1f5a7dda454381dcef4959dfd18c96749e58 /app/controllers/new_controller.rb
parent25c8cd36938253a60a4bf070961014155aa67535 (diff)
Login and logout links at top right when you are logged out or logged in.
Redirect the full URI for login, not just the action/controller. After making request, redirect to the URL for the request with a flash to say it is made.
Diffstat (limited to 'app/controllers/new_controller.rb')
-rw-r--r--app/controllers/new_controller.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/new_controller.rb b/app/controllers/new_controller.rb
index 84fb0fb81..1da6f1398 100644
--- a/app/controllers/new_controller.rb
+++ b/app/controllers/new_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: new_controller.rb,v 1.3 2007-10-09 17:29:43 francis Exp $
+# $Id: new_controller.rb,v 1.4 2007-10-10 16:06:17 francis Exp $
class NewController < ApplicationController
def index
@@ -24,16 +24,18 @@ class NewController < ApplicationController
# This automatically saves dependent objects, such as @info_request, in the same transaction
if not @info_request.valid?
render :action => 'index'
- elsif check_authentication
+ elsif authenticated?
@info_request.user = authenticated_user
@info_request.save
+ flash[:notice] = "Your Freedom of Information request has been created."
+ redirect_to :controller => 'request', :id => @info_request
end
# Save both models
# valid = @info_request.valid?
# valid &&= @outgoing_message.valid? # XXX maybe there is a nicer way of preventing lazy boolean evaluation than this
# if valid
-# if check_authentication
+# if authenticated?
# @info_request.save!
# @outgoing_message.save!
# end