Search code examples
ruby-on-railscontent-management-systemruby-on-rails-4asset-pipelinecomfortable-mexican-sofa

Comfortable mexican sofa - how the assets are served?


One of the impressive features in Comfortable Mexican Sofa is editing js and stylesheets online. There is no need to deploy each time the assets are changed. I suppose javascript and stylesheets code is stored in database.

I am curious if those assets are precompiled and served by the pipeline, like regular assets in a Rails application?


Solution

  • They are served as a normal controller/action response. Run rake routes and take a look at cms_content_css and cms_content_js paths. So there's an overhead compared to serving precompiled assets. This is not an issue with relatively low traffic sites, but when server load is a concern you probably want to implement some sort of caching.