I have a basic static webpage.
class StaticPagesController < ApplicationController def home end end
And there is home.html.erb with only a title. This works great in development, but the test
test "should get home" do get :home assert_response :success assert_select "title","home | #{@base}" end
with an error
ActionView::Template::Error: ActionView::Template::Error: undefined method []' for nil:NilClass
Showing error in application.html.erb
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
This is the line shown as the causing error. What causes the problem?
It works when I return stylesheet_link_tag.
*= require_tree *= require_self @import "bootstrap-sprockets"; @import "bootstrap";
This is my application.css application. There are two more scss files in the styles directory.
Found a problem and fixed it. But I donβt understand why this is happening. The bootstrap should have been moved to the sass file in the same directory, and there is no error. But why is this happening? His work is in development.
source share