My application has a controller that uses a different layout called "special":
class SessionsController < ApplicationController layout "special" ... end
So, I created a new layouts/special.html.erb :
<!DOCTYPE html> <html> <head> <title></title> <%= stylesheet_link_tag "special" %> <%= csrf_meta_tags %> </head> <body> <%= yield %> </body> </html>
I also created a new matching stylesheets/special.css
The problem is that when I try to access a page with a special layout, I get an exception:
Asterisks :: Helpers :: RailsHelper :: AssetPaths :: AssetNotPrecompiledError in sessions # new
special.css isn't precompiled
I have already completed bundle exec rake assets:precompile , but this did not bundle exec rake assets:precompile problem. What's wrong? How to associate a stylesheet with a layout in rails?
source share