Created
May 14, 2010 17:37
-
-
Save vsalbaba/401410 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionController::Routing::Routes.draw do |map| | |
map.with_options :path_prefix => '/:account_id' do |map| | |
map.resources :collections | |
end | |
end | |
module ActionView | |
module Helpers | |
module UrlHelper | |
alias :real_url_for :url_for | |
def url_for(options={}) | |
account_options = {:account_id => params[:account_id]} | |
options.merge!(account_options) if options.is_a?(Hash) | |
real_url_for(options) | |
end | |
end | |
end | |
end | |
<%= link_to h(collection.name), collection %> | |
#collection_url failed to generate from {:action=>"show", :account_id=>"test", :controller=>"collections"}, expected: {:action=>"show", :controller=>"collections"}, diff: {:account_id=>"test"} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment