outside2344
outside2344

Reputation: 2115

Routing issue with Rails 3

Rails newbie question that I can't seem to figure out. At some point I managed to break routing from one of my resources in my application sitewide. I'm getting the following for every page on my site:

Routing Error

No route matches {:action=>"show", :controller=>"assets", :ext=>"css", :body=>true, :digest=>false, :id=>#}

If I remove the <%= stylesheet_link_tag "application" %> and <%= javascript_include_tag "application" %> everything works correctly.

I have the following in my route.rb file:

  resources :security_prices
  resources :securities
  resources :assets

  resources :portfolios do
    resources :accounts
  end

but when I do a

rake routes

I get:

       security_prices GET    /security_prices(.:format)                            {:action=>"index", :controller=>"security_prices"}
                       POST   /security_prices(.:format)                            {:action=>"create", :controller=>"security_prices"}
    new_security_price GET    /security_prices/new(.:format)                        {:action=>"new", :controller=>"security_prices"}
   edit_security_price GET    /security_prices/:id/edit(.:format)                   {:action=>"edit", :controller=>"security_prices"}
        security_price GET    /security_prices/:id(.:format)                        {:action=>"show", :controller=>"security_prices"}
                       PUT    /security_prices/:id(.:format)                        {:action=>"update", :controller=>"security_prices"}
                       DELETE /security_prices/:id(.:format)                        {:action=>"destroy", :controller=>"security_prices"}
            securities GET    /securities(.:format)                                 {:action=>"index", :controller=>"securities"}
                       POST   /securities(.:format)                                 {:action=>"create", :controller=>"securities"}
          new_security GET    /securities/new(.:format)                             {:action=>"new", :controller=>"securities"}
         edit_security GET    /securities/:id/edit(.:format)                        {:action=>"edit", :controller=>"securities"}
              security GET    /securities/:id(.:format)                             {:action=>"show", :controller=>"securities"}
                       PUT    /securities/:id(.:format)                             {:action=>"update", :controller=>"securities"}
                       DELETE /securities/:id(.:format)                             {:action=>"destroy", :controller=>"securities"}
    portfolio_accounts GET    /portfolios/:portfolio_id/accounts(.:format)          {:action=>"index", :controller=>"accounts"}
                       POST   /portfolios/:portfolio_id/accounts(.:format)          {:action=>"create", :controller=>"accounts"}
 new_portfolio_account GET    /portfolios/:portfolio_id/accounts/new(.:format)      {:action=>"new", :controller=>"accounts"}
edit_portfolio_account GET    /portfolios/:portfolio_id/accounts/:id/edit(.:format) {:action=>"edit", :controller=>"accounts"}
     portfolio_account GET    /portfolios/:portfolio_id/accounts/:id(.:format)      {:action=>"show", :controller=>"accounts"}
                       PUT    /portfolios/:portfolio_id/accounts/:id(.:format)      {:action=>"update", :controller=>"accounts"}
                       DELETE /portfolios/:portfolio_id/accounts/:id(.:format)      {:action=>"destroy", :controller=>"accounts"}
            portfolios GET    /portfolios(.:format)                                 {:action=>"index", :controller=>"portfolios"}
                       POST   /portfolios(.:format)                                 {:action=>"create", :controller=>"portfolios"}
         new_portfolio GET    /portfolios/new(.:format)                             {:action=>"new", :controller=>"portfolios"}
        edit_portfolio GET    /portfolios/:id/edit(.:format)                        {:action=>"edit", :controller=>"portfolios"}
             portfolio GET    /portfolios/:id(.:format)                             {:action=>"show", :controller=>"portfolios"}
                       PUT    /portfolios/:id(.:format)                             {:action=>"update", :controller=>"portfolios"}
                       DELETE /portfolios/:id(.:format)                             {:action=>"destroy", :controller=>"portfolios"}
            home_index GET    /home/index(.:format)                                 {:controller=>"home", :action=>"index"}
                  root        /                                                     {:controller=>"home", :action=>"index"}

which obviously doesn't have assets so I suspect I'm flubbing something. How do I go about debugging this?

Upvotes: 1

Views: 699

Answers (1)

davidb
davidb

Reputation: 8954

remove the resources :assets from the routes.rb rails is doing this on its own you dont need ressources for that!

Upvotes: 3

Related Questions