Class: SitemapsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SitemapsController
- Defined in:
- app/controllers/sitemaps_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/controllers/sitemaps_controller.rb', line 4 def index @entries = {} Cms::SitemapSubmitter.models.each do |model| last_update = model.classify.constantize.bcms_sitemap_last_update @entries[model.pluralize] = last_update if last_update end end |
#model ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/sitemaps_controller.rb', line 12 def model model = params[:model] @objects = model.classify.constantize.bcms_sitemap_scope instance_variable_set("@#{model}", @objects) # Template usually wants @pages, @news_articles etc if Rails.root.join('app','views','sitemaps',"#{model}.builder").exist? render "#{model}.builder" else render 'model.builder' end end |