Skip to content

erikhatcher/velaro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Home of Apache Velocity integration with JRuby on Rails.

Current state:

Rails ActionView::TemplateHandler implementation, supporting instance and local variables as $variables.

Future goals:

  * Velocity RubyUberspect to cleanly use RubyObjects
  * Dynamic macro hook to allow Rails helpers like url_for to work as a #url_for macro
  
FAQ
  Q: What's the big picture?
  A: Renders templates with .vel suffix through the Apache Velocity template engine

  Q: What's Velocity?
  A: http://velocity.apache.org

  Q: What's the name all about?
  A: Velocity + Rails => high speed rail => http://en.wikipedia.org/wiki/High-speed_rail,
     where the Siemens Velaro appears.  Velaro begins with "vel"ocity.

  Q: Will this work with MRI Ruby?
  A: No, it requires JRuby.

Example:

example_controller.rb
---------------------
class ExampleController < Application
  layout false
  def index
    @var = "whatever"
  end
end

index.html.vel
--------------
<html>
  <head><title>Velaro Demo</title></head>
  <body>
    The value of @var is <b>$var</b>
  </body>
</html>

Output
------
<html>
  <head><title>Velaro Demo</title></head>
  <body>
    The value of @var is <b>whatever</b>
  </body>
</html>

About

JRuby on Rails VelocityTemplateHandler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published