diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/request_controller.rb | 17 | ||||
-rw-r--r-- | app/views/request/new.rhtml | 2 |
2 files changed, 10 insertions, 9 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. diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index 8621fdf9e..b14e40f1d 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -13,7 +13,7 @@ <%= foi_error_messages_for :info_request, :outgoing_message %> -<% form_for(:info_request, @info_request, :url => { :action => :create }, :html => { :id => 'writeForm' } ) do |f| %> +<% form_for(:info_request, @info_request, :html => { :id => 'writeForm' } ) do |f| %> <label class="form_label" for="heading"> </label> <h1>New public Freedom of Information request</h1> |