<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Retro Rubies]]></title>
  <link href="http://retro.apicko.cz//atom.xml" rel="self"/>
  <link href="http://retro.apicko.cz//"/>
  <updated>2012-02-01T21:32:49+01:00</updated>
  <id>http://retro.apicko.cz//</id>
  <author>
    <name><![CDATA[Josef Šimánek]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[ZOMG! Refinery 2 now as mountable engine!]]></title>
    <link href="http://retro.apicko.cz//blog/2012/02/01/zomg-refinery-2-now-as-mountable-engine/"/>
    <updated>2012-02-01T16:48:00+01:00</updated>
    <id>http://retro.apicko.cz//blog/2012/02/01/zomg-refinery-2-now-as-mountable-engine</id>
    <content type="html"><![CDATA[<p>Most widely used Rails CMS (according to <a href="https://www.ruby-toolbox.com/categories/content_management_systems">ruby-toolbox</a>) passed a big
<a href="https://github.com/resolve/refinerycms/pull/1234#issuecomment-3753169">change</a>. You can send your thanks to <a href="https://github.com/ugisozols">ugisozols</a> and <a href="https://github.com/parndt">parndt</a>. It is fully namespaced now and available as mountable engine, so you can easily
attach it into your existing application.</p>

<p>You can try new Refinery from github master via rails template.</p>

<div><script src='https://gist.github.com/1718707.js?file='></script>
<noscript><pre><code>gem install rails
rails new retrorubies -m https://github.com/resolve/refinerycms/raw/master/templates/refinery/edge.rb</code></pre></noscript></div>


<p>You can now mount refinery where you will need inside yours <code>config/routes.rb</code>.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>Retrorubies::Application.routes.draw do
</span><span class='line'>  mount Refinery::Core::Engine =&gt; '/awesome-refinery-path'
</span><span class='line'>end</span></code></pre></td></tr></table></div></figure>


<h2>Refinery settings refactored hard!</h2>

<p>Instead of old style settings saved in your refinery_settings database table Refinery now provides a couple of initializers. You can find them in <code>config/initialiters/refinery</code>. You can specify there settings like site languages or site name.</p>

<p>There are also two brand new features in core.rb initializer. You can now specify custom backend assets (javascript or stylesheet) in <code>config/initializers/refinery/core.rb</code>. This is <a href="https://github.com/simi">my</a> <a href="https://github.com/resolve/refinerycms/pull/1266">work</a> and it is inspired by awesome <a href="https://github.com/gregbell">Greg Bell</a>&#8217;s <a href="https://github.com/gregbell/active_admin">Active Admin</a>.</p>

<p>You can also specify html tags whitelist for included wysiwyg <a href="http://www.wymeditor.org/">WYMeditor</a>. This <a href="https://github.com/resolve/refinerycms/commit/f44241e8c81f4b82bd66ad433fb20fcef499abcf">feature</a> is result of <a href="https://github.com/parndt">parndt</a>&#8217;s awesome work. So you definitely should nominate him to <a href="http://rubyheroes.com/">rubyhero</a> for his great work.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>Refinery::Core.configure do |config|
</span><span class='line'>  # Add extra tags to the wymeditor whitelist e.g. = {'tag' =&gt; {'attributes': '1': 'href'}} or just {'tag' =&gt; {}}
</span><span class='line'>  # config.wymeditor_whitelist_tags = {}
</span><span class='line'>
</span><span class='line'>  # Register extra javascript for backend
</span><span class='line'>  # config.register_javascript "prototype-rails"
</span><span class='line'>
</span><span class='line'>  # Register extra stylesheet for backend (optional options)
</span><span class='line'>  # config.register_stylesheet "custom", :media =&gt; 'screen'
</span><span class='line'>end</span></code></pre></td></tr></table></div></figure>


<h2>Should I upgrade to use those cool features right now ?</h2>

<p>If you are using some custom engines or overrided parts don&#8217;t do this. There is a lot of changes in namespacing and in conclusion there are not backwards compatible routes.</p>

<p>For adventurers: you can inspire by <a href="https://github.com/parndt">parndt</a>&#8217;s <a href="https://github.com/resolve/refinerycms-blog/commit/33bfa4dd231e4042456b3a70059c9cf57af858cf">rework</a> of <a href="https://github.com/resolve/refinerycms-blog">refinerycms-blog</a> for latest refinery master branch. <em>Isn&#8217;t it another good reason for <a href="http://rubyheroes.com">rubyhero</a> nomination ?</em></p>
]]></content>
  </entry>
  
</feed>
