Sha256: f20854a326a6b5796b72246b6644f041a08f11d18251be2caf6809ba63571ce0
Contents?: true
Size: 721 Bytes
Versions: 59
Compression:
Stored size: 721 Bytes
Contents
module Para module Admin module ResourcesHelper def resource_form_path(resource) if resource.new_record? resource_path(resource, :index) else resource_path(resource, :show) end end def resource_path(resource, action =:index) resource = resource.kind_of?(Class) ? resource.new : resource route_key = resource.class.model_name.route_key component_path = @component && @component.to_param id = resource.id if [:index, :show, :create, :update, :destroy].include?(action) action = nil end ["", "admin", component_path, route_key, id, action].compact.join('/') end end end end
Version data entries
59 entries across 59 versions & 1 rubygems