Giter Club home page Giter Club logo

Comments (11)

nex3 avatar nex3 commented on May 15, 2024

This is because of the new Sass/Rails integration, in which Sass stylesheets are treated as Rails views rather than compiled separately. If you put your stylesheets in app/views (as .css.scss or .css.sass), they'll work from there.

I'll leave this issue open to remind me to print a message about this when Sass notices you have a public/stylesheets/sass directory.

from sass.

slbug avatar slbug commented on May 15, 2024

so even is css_dir = "public/stylesheets" i should put my css.scss files to css_dir = "public/stylesheets/sass"?

from sass.

slbug avatar slbug commented on May 15, 2024

tried to put *.css.scss to app/views/stylesheets and changed compass config, but it still not works.

from sass.

nex3 avatar nex3 commented on May 15, 2024

Do you have routing and a controller set up for app/views/stylesheets?

from sass.

slbug avatar slbug commented on May 15, 2024

no. should i?

from sass.

nex3 avatar nex3 commented on May 15, 2024

Yes, since they're just views, they need to have routes and a controller set up just like other views.

from sass.

slbug avatar slbug commented on May 15, 2024

ok. thanks it works, but as i understood it wont generate css files anymore. and i think it's bad, because it won't be possible to handle css requests without rails (only using apache or nginx).

from sass.

nex3 avatar nex3 commented on May 15, 2024

You can always manually include Sass::Plugin::Rack in your middleware stack if you want to generate static CSS files. However, under most configurations, you'll still be hitting Rack/Rails somewhere in the stack.

from sass.

maca avatar maca commented on May 15, 2024

Compass init generates sass files in the previous place, I moved my stylesheets into app/views/stylesheets, created an stylesheets controller and setted my routes but I still get this error.

ActionView::MissingTemplate (Missing template stylesheets/screen with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml, :haml], :formats=>[:css], :locale=>[:"pt-BR", :"pt-BR"]} in view paths

from sass.

nex3 avatar nex3 commented on May 15, 2024

@maca: rather than re-opening old, tangentially related issues, please start a new issue. Also, please provide more detailed information about the steps that you're taking, the precise problem you're seeing, and how to reproduce it.

from sass.

maca avatar maca commented on May 15, 2024

Well I am starting a new vanilla rails app and I want to use compass and susy, I ran compass init and compass generated the sass files in app/stylesheets. From what I read in this thread having sass files in app/stylesheets is no longer the standard way and for rails integration I should create a controller for my stylesheets and store my sass files in app/views, right?

Now the problem is that apparently there is no handler for sass files so the controller doesn't know what to do with my sass templates even though they are there and are named *.css.sass.

My inmediate temporary workaround was mounting a Sinatra app and using Tilt to render the sass templates, ok, it works but gets me into other issues with compass such as this:

 Sass::SyntaxError - File to import not found or unreadable: susy/susy.
 Load path: .:

I joined this thread because I was having the same issue as slbug:

 ActionController::RoutingError (No route matches "/stylesheets/screen.css"):

from sass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.