Module: ActionDispatch::Routing::Mapper::Resources

Defined in:
lib/calligraphy/rails/mapper.rb

Defined Under Namespace

Classes: Resource

Instance Method Summary collapse

Instance Method Details

#calligraphy_resource(*resources, &block) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/calligraphy/rails/mapper.rb', line 87

def calligraphy_resource(*resources, &block)
  options = resources.extract_options!.dup

  if apply_common_behavior_for :calligraphy_resource, resources, options, &block
    return self
  end

  with_scope_level(:resource) do
    options = apply_action_options options
    singleton_resoure = ActionDispatch::Routing::Mapper::SingletonResource
    resource_scope(singleton_resoure.new resources.pop, api_only?, @scope[:shallow], options) do
      yield if block_given?

      concerns(options[:concerns]) if options[:concerns]

      set_mappings_for_web_dav_resources
    end
  end
end