diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-11-19 10:26:20 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-11-19 11:27:23 +0000 |
commit | 259a0fd588e198d2a826ef4ac09284c610005387 (patch) | |
tree | 26c49cf1cc60ac4dd9d8109dbdf8d8ae82a39eea /app/controllers/admin_censor_rule_controller.rb | |
parent | 06771a09cf73d28b1f3520817f9a3dc03cc7b877 (diff) |
Set the form URL to POST to in #new
Direct the form at the correct route for the association (or use the
generic route if the rule is being created for some other reason)
Diffstat (limited to 'app/controllers/admin_censor_rule_controller.rb')
-rw-r--r-- | app/controllers/admin_censor_rule_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/admin_censor_rule_controller.rb b/app/controllers/admin_censor_rule_controller.rb index c5d2b16c1..a5e2502b0 100644 --- a/app/controllers/admin_censor_rule_controller.rb +++ b/app/controllers/admin_censor_rule_controller.rb @@ -9,13 +9,17 @@ class AdminCensorRuleController < AdminController if params[:info_request_id] @info_request = InfoRequest.find(params[:info_request_id]) @censor_rule = @info_request.censor_rules.build + @form_url = admin_info_request_censor_rules_path(@info_request) end + if params[:user_id] @censor_user = User.find(params[:user_id]) @censor_rule = @censor_user.censor_rules.build + @form_url = admin_user_censor_rules_path(@censor_user) end @censor_rule ||= CensorRule.new + @form_url ||= admin_rule_create_path end def create |