Skip to content

benilovj/velocity_on_rails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VelocityOnRails

This is a Rails plugin for using Velocity (velocity.apache.org/) templates in your views under JRuby. It might be useful if you are migrating a Java project to Rails.

This is compatible with Rails 3.0.

Building The Gem

git clone http://github.com/benilovj/velocity_on_rails.git
cd velocity_on_rails
gem build velocity_on_rails.gemspec

Installation

  • Install the gem.

  • Add the following line to your Rails Gemfile: gem ‘velocity_on_rails’

  • Invoke the command: bundle install

to install the gem.

Usage

Place Velocity templates under apps/views with the .vel extension.

You can inject variables into your views by providing a variables Hash to the :locals:

class DemoController < ApplicationController
  def index
    render :layout => false, :locals => {:page_title => "demo"}
  end
end

It is possible to use the Velocity #parse command, but the path specified needs to be relative to ‘Rails.home/app/views’.

Copyright © 2010 Jake Benilov, released under the MIT license

About

Rails plugin for using Velocity (http://velocity.apache.org/) templates in your views under JRuby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages