Module: Sitemapper::Adapters::RailsAdapter::RoutesMapperExtension
- Defined in:
- lib/sitemapper/adapters/rails_adapter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #connect_with_sitemap(path, options = {}) ⇒ Object
- #named_route_with_sitemap(name, path, options = {}) ⇒ Object
- #root_with_sitemap(options = {}) ⇒ Object
Class Method Details
.included(base) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/sitemapper/adapters/rails_adapter.rb', line 5 def self.included(base) base.class_eval do alias_method_chain :named_route, :sitemap alias_method_chain :connect, :sitemap alias_method_chain :root, :sitemap end path = File.join(Rails.root, 'public', 'sitemap_static.xml.gz') File.unlink(path) if File.exists?(path) @@map = Sitemapper::map_index.build_map(path) end |
Instance Method Details
#connect_with_sitemap(path, options = {}) ⇒ Object
21 22 23 24 |
# File 'lib/sitemapper/adapters/rails_adapter.rb', line 21 def connect_with_sitemap(path, = {}) map_if_possible(path, ) connect_without_sitemap(path, ) end |
#named_route_with_sitemap(name, path, options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/sitemapper/adapters/rails_adapter.rb', line 16 def named_route_with_sitemap(name, path, = {}) map_if_possible(path, ) named_route_without_sitemap(name, path, ) end |
#root_with_sitemap(options = {}) ⇒ Object
26 27 28 29 |
# File 'lib/sitemapper/adapters/rails_adapter.rb', line 26 def root_with_sitemap( = {}) map_if_possible('/', ) root_without_sitemap() end |