Sha256: 6f2442738294c7e881b4fa9c953f25866b51bb844dd87f2ee2079ba97f1abb06
Contents?: true
Size: 937 Bytes
Versions: 15
Compression:
Stored size: 937 Bytes
Contents
module Admin module ListHelper def resources_actions @resources_actions ||= [] end def list_actions resources_actions.map do |body, url, options| if admin_user.can?(url[:action], @resource.name) path = params.dup.merge!(url).compact.cleanup link_to Typus::I18n.t(body), path, options end end.compact.join(" / ").html_safe end #-- # If partial `list` exists we will use it. This partial will have available # the `@items` so we can do whatever we want there. Notice that pagination # is still available. #++ def build_list(model, fields, items, resource = @resource.to_resource, link_options = {}, association = nil, association_name = nil) render "admin/#{resource}/list", :items => items rescue ActionView::MissingTemplate build_table(model, fields, items, link_options, association, association_name) end end end
Version data entries
15 entries across 15 versions & 1 rubygems