[v4.0] Addressable Content Blocks
Clone this wiki locally
Addressable Content Blocks
Content blocks can created with as their own pages. To make a block addressable, a developer must do the following:
- Add is_addressable to the model. This will automatically generate a :slug form field when creating/editing instances.
- Set the Page Template that should be used (defaults to 'default').
class Product < ActiveRecord::Base is_addressable path: "/products", template: "product" end
- Add the following field to the _form.html.erb.
<%= f.input :slug, as: :path %>