How do I completely remove all references to application.js and application.css in a Rails app?

Tags: javascript,html,css,ruby-on-rails,ruby-on-rails-4

Problem :

I'm working in Rails 4.2.4 to deploy a very simple Web API. This interface does not require JavaScript or CSS, so the requests for application.js and application.css are just generating log spam and increasing response times. I have tried disabling assets and skipping sprockets, but the pages served by the app continue to reference application.js and application.css, even in my "Hello, world!" controller generated from the Getting Started Guide.

How can I permanently disable references to these non-existent, unrequired files?

Solution :

Modify your ./app/views/layouts/application.html.erb to only have the following content:

<%= yield %>

In other words, remove the <html>, <head>, and <body> tags. There are several other ways to achieve your objective, but this might be the easiest.

    CSS Howto..

    How to trigger css :hover event on PageLoad

    How to get position of div inside td

    Does anyone know how to create this 3d flip animation via CSS?

    how do i hide anchor text without hiding the anchor

    How to insert a div below dynamic divs row after onclick

    How to preserve margins and expand a div to fit its contents size?

    How to restore WordPress theme style,css from caches on internet

    How to get element to fill 100% height of parent

    How to set animation in css?

    how to add css on click and remove it when they click close button [closed]

    How can I avoid div overflowing my container without using overflow:hidden?

    How to point to a specific icon in an icon set?

    How to turn off spell checking in CSS?

    how to center css class images with text?

    html element h1 with links as background image show them in one line

    How I can make nice looking matrix of buttons with bootstrap 3?

    css how to make the background image padding to right

    How to find and delete specific row in blogger css with span tag?

    How to Override CSS class?

    Is it possible to see how your html & css code would look on a mobile device without actually have a website url?

    How to show a background image over foreground image using CSS

    How to program the navigation bar(image) web html

    how to make a double hover effect with css

    How to assign a unique CSS id to each cell in a jqGrid?

    How to find number of style classes defined in a CSS file

    How do I center a menu option under it's heading option in a drop down menu?

    Having Two HTML issues with PHP DOM: 1.) DOMDocument::createEntityReference $name values and 2.) how to add multiple CSS classes an element?

    How to achieve parallax behind horizontal bars while scrolling

    How to create the corner that show in picture with css in webpage?

    How to set width of an element in %