Retro Rubies

Everything what is today IN will be tomorrow OUT and day after it will be RETRO.

ZOMG! Refinery 2 Now as Mountable Engine!

| Comments

Most widely used Rails CMS (according to ruby-toolbox) passed a big change. You can send your thanks to ugisozols and parndt. It is fully namespaced now and available as mountable engine, so you can easily attach it into your existing application.

You can try new Refinery from github master via rails template.

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

1
2
3
Retrorubies::Application.routes.draw do
  mount Refinery::Core::Engine => '/awesome-refinery-path'
end

Refinery settings refactored hard!

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

There are also two brand new features in core.rb initializer. You can now specify custom backend assets (javascript or stylesheet) in config/initializers/refinery/core.rb. This is my work and it is inspired by awesome Greg Bell’s Active Admin.

You can also specify html tags whitelist for included wysiwyg WYMeditor. This feature is result of parndt’s awesome work. So you definitely should nominate him to rubyhero for his great work.

1
2
3
4
5
6
7
8
9
10
Refinery::Core.configure do |config|
  # Add extra tags to the wymeditor whitelist e.g. = {'tag' => {'attributes': '1': 'href'}} or just {'tag' => {}}
  # config.wymeditor_whitelist_tags = {}

  # Register extra javascript for backend
  # config.register_javascript "prototype-rails"

  # Register extra stylesheet for backend (optional options)
  # config.register_stylesheet "custom", :media => 'screen'
end

Should I upgrade to use those cool features right now ?

If you are using some custom engines or overrided parts don’t do this. There is a lot of changes in namespacing and in conclusion there are not backwards compatible routes.

For adventurers: you can inspire by parndt’s rework of refinerycms-blog for latest refinery master branch. Isn’t it another good reason for rubyhero nomination ?