Cells v4.0.0 Release Notes

    • ๐Ÿš… Rails Support: Rails 4.0+ is fully supported, in older versions some form helpers do not work. Let us know how you fixed this.
    • State args: View models don't use state args. Options are passed into the constructor and saved there. That means that caching callbacks no longer receive arguments as everything is available via the instance itself.
    • ๐Ÿ”ง ViewModel.new(song: song) won't automatically create a reader #song. You have to configure the cell to use a Struct twin {TODO: document}
    • HTML Escaping: Escaping only happens for defined propertys when Escaped is included.
    • Template Engines: There's now one template engine (e.g. ERB or HAML) per cell class. It can be set by including the respective module (e.g. Cell::Erb) into the cell class. This happens automatically in Rails.
    • File Naming. The default filename just uses the engine suffix, e.g. show.haml. If you have two different engine formats (e.g. show.haml and show.erb), use the format: option: render format: :erb. If you need to render a specific mime type, provide the filename: render view: "show.html".
    • ๐Ÿ— Builder blocks are no longer executed in controller context but in the context they were defined. This is to remove any dependencies to the controller. If you need e.g. params, pass them into the #cell(..) call.
    • ๐Ÿ— Builders are now defined using ::builds, not ::build.

    โœ‚ Removed

    • ๐Ÿšš Cell::Rails and Cell::Base got removed. Every cell is ViewModel or Concept now.
    • All methods from AbstractController are gone. This might give you trouble in case you were using helper_method. You don't need this anymore - every method included in the cell class is a "helper" in the view (it's one and the same method call).