I am getting the following error in my rails app when I run it locally:
ActionView::Template::Error (wrong number of arguments (2 for 1)):
8: %link{href: "/assets/favico.png", rel: "icon"}/
9: %link{href: "https://fonts.googleapis.com/css?family=Open+Sans:400,700", rel: "stylesheet", type: "text/css"}/
10: = stylesheet_link_tag "application", :media => "all"
11: = javascript_include_tag "application"
12: = csrf_meta_tags
13: = yield(:head)
app/views/layouts/application.html.haml:10:in `_app_views_layouts_application_html_haml___410024948890833714_70223805533300'
I have deployed the app on heroku and there are no issues. This issue occurred recently after I updated from rails3 to rails 4.
Instead of using the helpers, adding the tags manually works:
%link{href: "/assets/application.css", media: "screen", rel: "stylesheet"}/
%script{src: "/assets/application.js"}
i'm assuming you are using sprockets 2.12.0, if that's the case, downgrade it to 2.11.0 as per https://github.com/sstephenson/sprockets/issues/540
I've found that the updated gems, which have in their instructions to change application.css to application.css.scss, won't recognize 'application' as a parameter for a scss file for stylesheet_link_tag. You need to change:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
to this:
<%= stylesheet_link_tag 'application.css.scss', media: 'all', 'data-turbolinks-track' => true %>
This will allow you to work with the latest gems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With