Re: [Rails] scss/sass for specific controller

20 views
Skip to first unread message

Walter Lee Davis

unread,
May 31, 2018, 8:03:27 PM5/31/18
to rubyonra...@googlegroups.com
Read more about how the Asset Pipeline works here: http://guides.rubyonrails.org//asset_pipeline.html

TL;DR: If you add an import statement to your application.scss to bring your posts.scss file into that parent (or have an import tree or similar that auto-includes it) then the SCSS that you write in posts.scss becomes part of the one-and-only compiled/minified/magically available EVERYWHERE application.css that it compiles into. There is never any different CSS on any page in your entire application. All pages get the same CSS and JS through the Asset Pipeline unless you did something very non-standard.

If you aren't seeing the effect you are after, after making sure all of the above is accurate, then you may have to also consider that the CSS selector isn't correct, and the browser is ignoring it since it does not apply to the actual page when it renders to HTML.

Walter

> On May 31, 2018, at 7:45 PM, fugee ohu <fuge...@gmail.com> wrote:
>
> if i put my styling in application.scss it works but placing it in posts.scss has no effect on app/views/posts/index.html.erb
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1560ea4b-4a80-4552-9379-f5349c2c08e2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

fugee ohu

unread,
May 31, 2018, 8:18:53 PM5/31/18
to Ruby on Rails: Talk
Wow you're right What a revelation Thanks Walter 
Reply all
Reply to author
Forward
0 new messages