Module: RenderHelper

Defined in:
app/helpers/render_helper.rb

Instance Method Summary collapse

Instance Method Details

#form_block(title = "", &block) ⇒ Object

Public: Render a fieldset.

title - (String) The title of this fieldset. If nil is passed

in, then no legend will be rendered, and the fieldset block
will not be added to the sidebar sections.

block - The body of the fieldset. Should return a String.

Examples

<%= form_block "Publishing" do %>
  <input type="text">...
<% end %>

Returns a String of the fieldset.



36
37
38
39
40
# File 'app/helpers/render_helper.rb', line 36

def form_block(title="", &block)
  render "/outpost/shared/form_block",
    :title => title,
    :body  => capture(&block)
end

#list_table(records, model, &block) ⇒ Object

Public: Render the table wrapper.

records - (Array) Records that are being represented in the table. model - (Class) The ActiveRecord model for this table. block - The rendered table. Should return a String.

Examples

<%= list_table @posts, Post do %>
  <table>...</table>
<% end %>

Returns a String of the table, or a message if no records are present.



15
16
17
18
19
20
# File 'app/helpers/render_helper.rb', line 15

def list_table(records, model, &block)
  render '/outpost/shared/list_table',
    :model   => model,
    :records => records,
    :table   => capture(&block)
end