ℹ️ Upgrading to version 0.10.0

(Aaron Russell) #1

:tada: Version 0.10.0 is out now! :tada:

There’s some potential breaking changes so this post is to share what’s new and the potential problems you may have with upgrading.

Changes which may break things!

mount_push_type changes

mount_push_type has been rewritten. It now accepts a different set of options and the resulting URLs of your PushType installation may have changed.

The admin and api engines are mounted as isolated engines at the specified mount point. The FrontEndController is still added to the host app, but you can pass a path option in case you don’t want the PushType front end at the root of your application.


# default options
mount_push_type admin: 'admin', api: 'api', front_end: '/'

# with customised options
mount_push_type admin: 'cms', front_end: 'pages'

Notice how previously the admin engine was mounted at “/push_type”. You can of course switch back to that path, but it is no longer the default.

Changes to route namespacing

PushType’s individual Rails engines now have distinct route namespaces. For example:

  • push_type_admin.nodes_path
  • push_type_api.nodes_path

Previously everything was accessed through the same namespace (push_type) - so if you’ve linked to any of the internal routes you’ll need to update the namespace for the correct path helper.

Have your root_path back, and welcome home_node_path

Previously PushType commandeered the root_path which caused an error if the host app set it’s own root_path. PushType no longer does this. Instead there is a new home_node_path which will render the home page as set through config.home_slug.

config.home_slug = false

In some cases, you may not even want a home page as your app handles that elsewhere. Now setting config.home_slug = false in config/initializers/push_type.rb will essentially remove the home_node_path entirely.

Changes to media_path url helpers

Previously, media_path expected a file_uid string passed to it. You can still do that so there should be no problems, but you can now just pass the Asset instance.


media_path(asset, style: '#200x200')

In addition, if you have set an asset_host in your Rails config, the media_path helper will use the asset host URL.

Changes to node_path url helpers

Previously, node_path expected a permalink string passed to it. As above, this still works, but you can now just pass the Node instance.



Other new features

API Engine

Under the hood PushType now has a full API for managing content. This is so new and shiny, even PushType doesn’t use it’s own API yet :stuck_out_tongue_winking_eye:! But moving forward this will play a much greater roll, both for the admin UI and external integrations.

More to come on this.

Ability to preview nodes

When editing a node, there is now a link (under the publish button) to preview it. This will render the node and it’s template regardless of it’s publish status.

The route for previewing a node maps to the FrontEndController. It is a public, unauthenticated URL so it can be shared with non users. It uses a base64 encoded identifier (derived from the node guid) and sets robots nofollow and no index headers, so these preview URLs shouldn’t end up in search engines.


There’s a few bug fixes in this version that won’t be fixed in 0.9.x.

Coming soon - version 0.10.0
Having trouble upgrading to 0.10.0
Remove need for node_path helper method
Coming soon - version 0.10.0
(Aaron Russell) #2

(Alex Brinkman) #3

On v 0.9.5, I’m only using push_type_core and push_type_admin. Do I need to add push_type_api when upgrading to 0.10.0?

(Aaron Russell) #4

You don’t need to explicitly install push_type_api. As of the beta, the api engine is a dependency of push_type_admin, so it will get installed anyway. But thinking about it, admin doesn’t use the api yet, and won’t probably for some months, so I’ll remove the dependency from the full release of 0.10.0. Then it’s up to you whether you want the api engine or not.