diff options
author | francis <francis> | 2008-01-04 15:12:32 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-04 15:12:32 +0000 |
commit | 26c033ba9e7cc0211881d0e388d05423567a81e4 (patch) | |
tree | a79e094f08f813f71c1a6b9496cbedcccec61c1d /app/controllers/request_controller.rb | |
parent | 9dedbd802e74af4b865cc2ef6ca2db9c5e23bdef (diff) |
Merge request's create action into the new action, so if you copy
the URL after posting the new request form it is still a working page.
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index bc03fd539..26318ef7d 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_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: request_controller.rb,v 1.27 2008-01-04 10:56:22 francis Exp $ +# $Id: request_controller.rb,v 1.28 2008-01-04 15:12:32 francis Exp $ class RequestController < ApplicationController @@ -23,15 +23,16 @@ class RequestController < ApplicationController def frontpage end - # Form for creating new request + # Page new form posts to def new - # Read parameters in - public body can be passed from front page - @info_request = InfoRequest.new(params[:info_request]) - @outgoing_message = OutgoingMessage.new(params[:outgoing_message]) - end + if params[:info_request].nil? || params[:outgoing_message].nil? + # Read parameters in - public body can be passed from front page + @info_request = InfoRequest.new(params[:info_request]) + @outgoing_message = OutgoingMessage.new(params[:outgoing_message]) + render :action => 'new' + return + end - # Page new form posts to - def create # See if the exact same request has already been submitted # XXX this *should* also check outgoing message joined to is an initial request (rather than follow up) # XXX this check could go in the model, except we really want to pass @existing_request to the view so it can link to it. |