Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Load view-specific CSS in Rails
def view_css
path = "views/#{params[:controller]}/#{params[:action]}"
stylesheet_link_tag(path) unless Rails.application.assets.find_asset(path).nil?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.