Variables
These are the available variables
@docs
Hash containing the data from XML
Display the main table
<%= render 'table' %>
Change all rows in a table
@docs.each do |doc|
doc["first name"] = doc["first name"].titleize
end
@show_fields
Array of fields to present from the @docs variable
Add field
@show_fields += ["first name", "last name"]
Quick add field
@show_fields << "address"
Remove field
@show_fields -= ["first name", "last name"]
Redefine order
Normally we define order in the fields tag when getting data, but we can also change order here
@show_fields = ["first name", "last name"]
params
The primary key and search parameters from the parent will be put in the hash called params
. Then the child view can use these values to fetch more data if needed, or do lookups.
params["person_id"]