Permalink
Browse files

Set the :id of a *path route to pages#show to nil to prevent URLs lik…

…e /news/test?path[]=about-us when on a page where some other object is using params[:id]
  • Loading branch information...
1 parent 78c1195 commit fcf78e961d8f5244c8edf5426ee37e263bbed75e @parndt parndt committed Sep 17, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 vendor/refinerycms/pages/app/models/page.rb
@@ -118,7 +118,8 @@ def link_url_localised?
end
def url_marketable
- {:controller => "/pages", :action => "show", :path => self.nested_url}
+ # :id => nil is important to prevent any other params[:id] from interfering with this route.
+ {:controller => "/pages", :action => "show", :path => self.nested_url, :id => nil}
end
def url_normal

0 comments on commit fcf78e9

Please sign in to comment.