aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/admin_general/index.html.erb2
-rw-r--r--app/views/admin_public_body/edit.html.erb2
-rw-r--r--app/views/admin_public_body/show.html.erb2
-rw-r--r--app/views/contact_mailer/update_public_body_email.text.erb2
-rw-r--r--config/routes.rb4
-rw-r--r--spec/controllers/public_body_change_requests_controller_spec.rb2
6 files changed, 6 insertions, 8 deletions
diff --git a/app/views/admin_general/index.html.erb b/app/views/admin_general/index.html.erb
index f9b6f5d3d..1107b0e93 100644
--- a/app/views/admin_general/index.html.erb
+++ b/app/views/admin_general/index.html.erb
@@ -205,7 +205,7 @@
<%= form_tag admin_change_request_update_path(@change_request), :class => "form form-horizontal" do %>
<%= submit_tag 'Close', :class => "btn btn-danger" %>
<%= link_to("Close and respond", admin_change_request_edit_path(@change_request), :class => 'btn') %>
- <%= link_to("Make update", admin_body_edit_path(@change_request.public_body, :change_request_id => @change_request.id), :class => 'btn btn-primary') %>
+ <%= link_to("Make update", edit_admin_body_path(@change_request.public_body, :change_request_id => @change_request.id), :class => 'btn btn-primary') %>
<% end %>
<% end %>
</div>
diff --git a/app/views/admin_public_body/edit.html.erb b/app/views/admin_public_body/edit.html.erb
index 9a757e5a3..7d317e84b 100644
--- a/app/views/admin_public_body/edit.html.erb
+++ b/app/views/admin_public_body/edit.html.erb
@@ -3,7 +3,7 @@
<div class="row">
<div class="span8">
<div id="public_body_form">
- <%= form_for @public_body, :url => admin_body_update_path(@public_body), :html => { :class => "form form-horizontal" } do |f| %>
+ <%= form_for @public_body, :url => admin_body_path(@public_body), :method => 'put', :html => { :class => "form form-horizontal" } do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<div class="form-actions">
<%= f.submit 'Save', :accesskey => 's', :class => "btn btn-success" %></p>
diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb
index f8161db26..40f341a22 100644
--- a/app/views/admin_public_body/show.html.erb
+++ b/app/views/admin_public_body/show.html.erb
@@ -45,7 +45,7 @@
</tr>
</tbody>
</table>
-<%= link_to _("Edit"), admin_body_edit_path(@public_body), :class => "btn btn-primary" %>
+<%= link_to _("Edit"), edit_admin_body_path(@public_body), :class => "btn btn-primary" %>
<% unless @public_body.url_name.nil? %>
<%=link_to _("Public page"), public_body_path(@public_body), :class => "btn" %>
<% else %>
diff --git a/app/views/contact_mailer/update_public_body_email.text.erb b/app/views/contact_mailer/update_public_body_email.text.erb
index 7d5a3dae0..f45a640ce 100644
--- a/app/views/contact_mailer/update_public_body_email.text.erb
+++ b/app/views/contact_mailer/update_public_body_email.text.erb
@@ -10,7 +10,7 @@
<%= @change_request.notes %>
<%= _('Update the address:') %>
-<%= admin_body_edit_path(@change_request.public_body, :change_request_id => @change_request.id, :only_path => false) %>
+<%= edit_admin_body_path(@change_request.public_body, :change_request_id => @change_request.id, :only_path => false) %>
<%= _('Close the request and respond:') %>
<%= admin_change_request_edit_url(:id => @change_request.id, :only_path => false ) %>
diff --git a/config/routes.rb b/config/routes.rb
index 2ed20d4ad..ee9f41c59 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -171,13 +171,11 @@ Alaveteli::Application.routes.draw do
#### AdminPublicBody controller
scope '/admin', :as => 'admin' do
resources :bodies,
- :except => [:create, :update, :edit, :destroy],
+ :except => [:create, :destroy],
:controller => 'admin_public_body' do
end
end
match '/admin/missing_scheme' => 'admin_public_body#missing_scheme', :as => :admin_body_missing
- match '/admin/body/edit/:id' => 'admin_public_body#edit', :as => :admin_body_edit
- match '/admin/body/update/:id' => 'admin_public_body#update', :as => :admin_body_update
match '/admin/body/create' => 'admin_public_body#create', :as => :admin_body_create
match '/admin/body/destroy/:id' => 'admin_public_body#destroy', :as => :admin_body_destroy
match '/admin/body/import_csv' => 'admin_public_body#import_csv', :as => :admin_body_import_csv
diff --git a/spec/controllers/public_body_change_requests_controller_spec.rb b/spec/controllers/public_body_change_requests_controller_spec.rb
index 9d6cfb26e..1c0b2ab35 100644
--- a/spec/controllers/public_body_change_requests_controller_spec.rb
+++ b/spec/controllers/public_body_change_requests_controller_spec.rb
@@ -92,7 +92,7 @@ describe PublicBodyChangeRequestsController, "creating a change request" do
mail.body.should include('new_body@example.com')
mail.body.should include(@public_body.name)
mail.body.should include("Please")
- mail.body.should include("http://test.host/admin/body/edit/#{@public_body.id}?change_request_id=")
+ mail.body.should include("http://test.host/admin/bodies/#{@public_body.id}/edit?change_request_id=")
mail.body.should include('http://test.host/admin/change_request/edit/')
end