ruby on rails - Can I Render A Layout Directly From routes.rb, Without A Controller? -
I would like to set a pair of style guides for the administrator of a website and the public sections.
Each will need its own layout, which will contain a mixture of static HTML and partially calls to make a call (no such static page will not cut it). There is no need for controller (s) to serve these pages and I do not want that which is effectively development-only content, it disrupts the rest of the code. I hope to think that there is no way to render the layout directly.
Disclaimer: I appreciate it that I should never do sometimes and I know why reasoning is the money. This idea is not good. I am interested in whether it is possible.
Is there any layout with no control directly from routes.rb
?
For some strange / stupid reason I wanted to render a blank JS file , And writing a controller felt too much for this kind of hack. Thanks for the reply @inikilabs, I used this 3 liner:
get 'analytics / some_file.js', for: - & gt; (Env) [200, {'Content-type' = & gt; 'App / javascript'}, [']] end
Comments
Post a Comment