Sha256: e319736c41ced5df03020d8089300f32532e0a9f7751fb5cac86c1d89933c301
Contents?: true
Size: 1 KB
Versions: 3
Compression:
Stored size: 1 KB
Contents
# Renee Render Rendering templates in Renee should be familiar and intuitive using the `render` command: ```ruby run Renee::Core.new { path('blog') do get { render! :haml, :"blogs/index" } end } ``` This above is the standard render syntax, specifying the engine followed by the template. You can also render without specifying an engine: ```ruby path('blog') do get { render! "blogs/index" } end ``` This will do a lookup in the views path to find the appropriately named template. You can also pass locals and layout options as you would expect: ```ruby path('blog') do get { render! "blogs/index", :locals => { :foo => "bar" }, :layout => :bar } end ``` This will render the "blogs/index.erb" file if it exists, passing the 'foo' local variable and wrapping the result in the 'bar.erb' layout file. You can also render without returning the response by using: ```ruby path('blog') do get { render "blogs/index" } end ``` This allows you to render the content as a string without immediately responding.
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
renee-render-0.1.1 | README.md |
renee-render-0.1.0 | README.md |
renee-render-0.0.1 | README.md |