Skip to content

Instantly share code, notes, and snippets.

@ChuckJHardy
Forked from averyvery/load-view-specific-css.rb
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChuckJHardy/03965832a9ac2a367bd1 to your computer and use it in GitHub Desktop.
Save ChuckJHardy/03965832a9ac2a367bd1 to your computer and use it in GitHub Desktop.
def view_css
path = "views/#{params[:controller]}/#{params[:action]}"
stylesheet_link_tag(path) unless Rails.application.assets.find_asset(path).nil?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment