Project

rhr

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby Hypertext Refinement -- the ease of PHP with the elegance of Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
>= 0
 Project Readme

Update Try rack-server-pages instead (more features/more docs/same aproach)

Ruby Hypertext Refinement -- the ease of PHP with the elegance of Ruby

Install

sudo gem install rhr

Usage

echo 'Hello <%= params["name"] || "RHR" %>' > index.erb
rhr server
--> http://localhost:3000
--> http://localhost:3000/index.erb?name=World

Layouting

Put a _layout. file into the root of the project. All pages will be rendered in the yield.

<html>
  <head>
    <title>Amazing</title>
  </head>
  <body><%= yield %></body>
</html>

Helpers

Put a helpers.rb file into the project root:

module Helpers
  def foo
    'bar'
  end
end

You can now use the foo method in the view:

<div><%= foo %></div>

TODO (fork!)

  • do not use layout if view does something like no_layout
  • add helpers like link_to / tag / form
  • move params and request to the View
  • escape html in params <-> xss

Author

Initial (crazy) idea by Steffen Schröder

Michael Grosser
michael@grosser.it
Hereby placed under public domain, do what you want, just do not hold me accountable...
Build Status