'Rails 3 stylesheet_link_tag and javascript_include_tag do not work after update
stylesheet_link_tag and javascript_include_tag have stopped working after I updated rails from 2.x to 3.1.3 (3.1.0)
Log
Started GET "/urls/604" for 77.88.42.27 at Mon Nov 21 11:00:20 +0200 2011
Processing by UrlsController#show as */*
Parameters: {"id"=>"604", "collection"=>{"tag_suggestions"=>:get}}
Url Load (0.8ms) SELECT `urls`.* FROM `urls` WHERE `urls`.`id` = ? LIMIT 1 [["id", "604"]]
Comment Load (0.9ms) SELECT `comments`.* FROM `comments` WHERE (is_active = 1 AND url_id = '604') ORDER BY created_at DESC
Rendered shared/_comments.html.erb (0.0ms)
Rendered urls/show.html.erb within layouts/application (57.6ms)
Compiled global.css (0ms) (pid 28092)
Completed 500 Internal Server Error in 663ms
ActionView::Template::Error (wrong number of arguments (2 for 1)):
19: -->
20:
21:
22: <%= stylesheet_link_tag 'global' %>
23: <%= javascript_include_tag 'jquery-1.6.4.min.js' %>
24: <%= javascript_include_tag 'jquery.corner.js' %>
25: <%= csrf_meta_tag %>
app/views/layouts/application.html.erb:22:in `_app_views_layouts_application_html_erb___1824233644_17244817840'
How I can fix this?
Solution 1:[1]
We saw this error after moving form Rails 3.0 to Rails 3.1. Our problem was that we had a helper in application_helper.rb called asset_path. asset_path is critical to Rails 3.1 and we were inadvertently overriding it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | gmoore |
