Search code examples
cssruby-on-railszend-frameworkstyleshead

Rails head style like in ZendFramework


Is it possible to do something similar (ZendFramework) but in rails?

<?php $this->headStyle()->captureStart() ?>
body {
    background-color: <?php echo $this->bgColor ?>;
}
<?php $this->headStyle()->captureEnd() ?>

Solution

  • Hi you can <header><%=yield :header%></header> in application.html.erb at header, now suppose you want to add some style at header in any other page of application you can do this via <%= content_for :head do %><style> background-color: <%= somecolor %><% end %>

    I am not php user so i don't know about zend but i hope this will solve your issue