%# displays the pencil and trash can icons used by the bootstrap index page. %>
<% if can_delete?(this_parent) %>
<% end %>
<%# This is the hobo_bootstrap customization of the index page.
It uses a table for the collection view, rather than the list of cards that hobo_clean uses.
To switch to a list of cards, parameterize your index page like this:
If you wish to customize the table instead, the collections param may be tweaked like any other `
`.
My
`actions` is defined in this tag. Remove it from `fields` to remove the column.
The best way to remove any of the actions is to adjust your permission functions. However, if you wish to remove or tweak in the view:
You will probably want to add sorting and searching options to your index page. These are not enabled by default since they require controller support. To do so, customize your index.dryml like this:
and your controller like this
def index
self.this = Widget.paginate(:page => params[:page]).
search(params[:search], :name).
order_by(parse_sort_param(:name, :quantity))
hobo_index
end
%>
New <%= model %>
<%
if this.first
klass = this.first.class
columns = standard_fields(klass)
field_names = columns.select {|f| can_view?(this.first, f)}
if can_edit?(this.first, field_names[0])
field_names << "actions"
end
# force to work only with strings
field_names.map!(&:to_s)
field_names.delete(klass.name_attribute.to_s)
field_names.unshift("this")
field_names = field_names.join(', ')
end
%>