diff options
-rw-r--r-- | app/helpers/application_helper.rb | 10 | ||||
-rw-r--r-- | app/models/info_request.rb | 4 | ||||
-rw-r--r-- | config/routes.rb | 6 |
3 files changed, 11 insertions, 9 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6f002e4a2..9c4c085dd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.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: application_helper.rb,v 1.8 2007-10-24 19:13:06 francis Exp $ +# $Id: application_helper.rb,v 1.9 2007-10-30 15:03:03 francis Exp $ module ApplicationHelper @@ -39,15 +39,17 @@ module ApplicationHelper return date.strftime("%e %B %Y") end + # Simplified links to our objects + def request_link(info_request) - link_to h(info_request.title), request_url(:id => info_request) + link_to h(info_request.title), show_request_url(:id => info_request) end def public_body_link_short(public_body) - link_to h(public_body.short_name), public_body_url(:short_name => public_body.short_name) + link_to h(public_body.short_name), show_public_body_url(:short_name => public_body.short_name) end def public_body_link(public_body) - link_to h(public_body.name), public_body_url(:short_name => public_body.short_name) + link_to h(public_body.name), show_public_body_url(:short_name => public_body.short_name) end def user_link(user) diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 4752a396f..7261978da 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.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: info_request.rb,v 1.8 2007-10-29 18:11:34 francis Exp $ +# $Id: info_request.rb,v 1.9 2007-10-30 15:03:03 francis Exp $ require 'digest/sha1' @@ -12,7 +12,7 @@ class InfoRequest < ActiveRecord::Base validates_presence_of :title belongs_to :user - validates_presence_of :user_id + #validates_presence_of :user_id # breaks during construction of new ones :( belongs_to :public_body validates_presence_of :public_body_id diff --git a/config/routes.rb b/config/routes.rb index 5c5cc905b..d4625d897 100644 --- a/config/routes.rb +++ b/config/routes.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: routes.rb,v 1.16 2007-10-30 14:49:08 francis Exp $ +# $Id: routes.rb,v 1.17 2007-10-30 15:03:04 francis Exp $ ActionController::Routing::Routes.draw do |map| # The priority is based upon order of creation: first created -> highest priority. @@ -18,7 +18,7 @@ ActionController::Routing::Routes.draw do |map| request.request_list '/list', :action => 'list' request.new_request '/new', :action => 'new' request.create_request '/create', :action => 'create' - request.request '/request/:id', :action => 'show' + request.show_request '/request/:id', :action => 'show' end map.with_options :controller => 'user' do |user| @@ -28,7 +28,7 @@ ActionController::Routing::Routes.draw do |map| user.show_user "/user/:name", :action => 'show' end - map.public_body "/body/:short_name", :controller => 'body', :action => 'show' + map.show_public_body "/body/:short_name", :controller => 'body', :action => 'show' map.connect '/admin/:action', :controller => 'admin', :action => 'index' map.connect '/admin/body/:action/:id', :controller => 'admin_public_body' |