Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[v4.0] Addressable Content Blocks
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 %>
Clone this wiki locally
Press h to open a hovercard with more details.