Sha256: ff3140a38d4849ecbc371969d4b435f24a28365972a0427d82cf2bb7d4e583a3
Contents?: true
Size: 1.02 KB
Versions: 13
Compression:
Stored size: 1.02 KB
Contents
module Admin::Resources::ListHelper def list_actions resources_actions_for_current_role.map do |body, url, options| path = params.dup.merge!(url).compact.cleanup link_to Typus::I18n.t(body), path, options end.compact.reverse.join(" / ").html_safe end def resources_actions_for_current_role resources_actions.reject do |body, url, options| admin_user.cannot?(url[:action], @resource.name) end end def build_actions(&block) render "helpers/admin/resources/actions", :block => block 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
Version data entries
13 entries across 13 versions & 1 rubygems