Ruby on Rails
MasterView Plugin (Version #10)

MasterView is a ruby/rails optimized HTML/XHTML friendly template engine. It is designed to use the full power and productivity of rails including layouts, partials, and rails html helpers while still being editable/styleable in a WYSIWYG HTML editor.

Goals

  • Create/extend a template engine for rails that would be XHTML friendly and thus could be edited/styled with a WYSIWYG HTML editor even late in development without breaking template.
  • Keep it simple. DRY. No extra config files, simple syntax with ruby flavor.
  • Design it specifically for ruby and rails. Use the full power and not be limited in its capabilities over what can be done with ERb
  • Work nicely with layouts, partials, and rails html helpers.
  • Reduce complexity, work with existing rails code, no extra view logic or hashes than what is used by ERb. Scaffold generate initial templates or work from existing html prototype.
  • Reduce the numbers of files, simplifying editing. Define partials and layouts naturallyl right in the template, no need to go to another file.
  • Preview in browser without running an app. Allow for dummy data in the template so that the page can be viewed and styled independently of the application.
  • Performance equal to ERb

MasterView is distributed as a gem or a plugin. You may install it as a gem and then generate a lightweight plugin which simply defers to the gem or you can install as a plugin which is self contained. I personally prefer installing as a gem for ease of management, however if you are running at a shared hosting environment you might not have authority to install this gem so you may install as a self contained plugin. Either way works identical once installed.

Rubyforge project: http://rubyforge.org/projects/masterview

Homepage: http://masterview.org/

svn: svn://rubyforge.org/var/svn/masterview/tags/masterview

Primary Developer: Jeff Barczewski (jeff.barczewski@ gmail.com)

Installation instructions

Plugin installation

script/plugin install svn://rubyforge.org/var/svn/masterview/tags/latest

or if you don’t have svn (subversion) installed then you may download the masterview_plugin.tgz or masterview_plugin.zip from http://rubyforge.org/projects/masterview and simply extract it manually into vendor/plugins/masterview

Alternate installation using gems

gem install masterview_gem_pack

script/generate masterview_plugin

This generate command creates a very small masterview plugin and init.rb file which points to the gem.

Usage

You may add MasterView attributes to existing (x)html or you may use the masterview generator to create a complete working application. The generator can create controllers, models, and the MasterView template file similar to how the built-in generator works. Simply change directory to your rails application and run the following

script/generate masterview YourModelName [YourControllerName]

Once it is done generating, the generated MasterView template file(s) will be created in app/views/masterview/*.html. These file(s) are html and can be edited with any standard html editor. The rails specific logic is contained in simple attributes which are ignored by html editors. The syntax for these attributes is heavily derived from the rails helper tags themselves so it should feel natural to the rails developer.

See also Plugins

MasterView is a ruby/rails optimized HTML/XHTML friendly template engine. It is designed to use the full power and productivity of rails including layouts, partials, and rails html helpers while still being editable/styleable in a WYSIWYG HTML editor.

Goals

  • Create/extend a template engine for rails that would be XHTML friendly and thus could be edited/styled with a WYSIWYG HTML editor even late in development without breaking template.
  • Keep it simple. DRY. No extra config files, simple syntax with ruby flavor.
  • Design it specifically for ruby and rails. Use the full power and not be limited in its capabilities over what can be done with ERb
  • Work nicely with layouts, partials, and rails html helpers.
  • Reduce complexity, work with existing rails code, no extra view logic or hashes than what is used by ERb. Scaffold generate initial templates or work from existing html prototype.
  • Reduce the numbers of files, simplifying editing. Define partials and layouts naturallyl right in the template, no need to go to another file.
  • Preview in browser without running an app. Allow for dummy data in the template so that the page can be viewed and styled independently of the application.
  • Performance equal to ERb

MasterView is distributed as a gem or a plugin. You may install it as a gem and then generate a lightweight plugin which simply defers to the gem or you can install as a plugin which is self contained. I personally prefer installing as a gem for ease of management, however if you are running at a shared hosting environment you might not have authority to install this gem so you may install as a self contained plugin. Either way works identical once installed.

Rubyforge project: http://rubyforge.org/projects/masterview

Homepage: http://masterview.org/

svn: svn://rubyforge.org/var/svn/masterview/tags/masterview

Primary Developer: Jeff Barczewski (jeff.barczewski@ gmail.com)

Installation instructions

Plugin installation

script/plugin install svn://rubyforge.org/var/svn/masterview/tags/latest

or if you don’t have svn (subversion) installed then you may download the masterview_plugin.tgz or masterview_plugin.zip from http://rubyforge.org/projects/masterview and simply extract it manually into vendor/plugins/masterview

Alternate installation using gems

gem install masterview_gem_pack

script/generate masterview_plugin

This generate command creates a very small masterview plugin and init.rb file which points to the gem.

Usage

You may add MasterView attributes to existing (x)html or you may use the masterview generator to create a complete working application. The generator can create controllers, models, and the MasterView template file similar to how the built-in generator works. Simply change directory to your rails application and run the following

script/generate masterview YourModelName [YourControllerName]

Once it is done generating, the generated MasterView template file(s) will be created in app/views/masterview/*.html. These file(s) are html and can be edited with any standard html editor. The rails specific logic is contained in simple attributes which are ignored by html editors. The syntax for these attributes is heavily derived from the rails helper tags themselves so it should feel natural to the rails developer.

See also Plugins