Inline_view_component

screenshot of Inline_view_component

Include template strings in Rails ViewComponent class definitions

Overview

InlineViewComponent is a gem that allows ViewComponents in Rails to define template strings within the class definition. It supports various templating languages such as ERB, HAML, and Slim, and also provides custom syntax highlighting for heredoc templates in Sublime Text.

Features

  • Template Strings: Define template strings within the ViewComponent class definition.
  • Support for Templating Languages: Compatible with templating languages like ERB, HAML, and Slim.
  • Custom Syntax Highlighting: Provides syntax highlighting for heredoc templates in Sublime Text.
  • Optional Template Format: You can specify the template format as an optional second argument to the template method.

Summary

InlineViewComponent is a gem that enhances the functionality of ViewComponents in Ruby on Rails. It allows developers to define template strings within the class definition, supporting various templating languages. Additionally, it provides custom syntax highlighting for heredoc templates in Sublime Text, making it easier to work with templates in the editor. The gem is available as open-source under the MIT License, and contributions are welcome.