public
Description: Rails Sitemap Plugin / Site Map Plugin for Rails. A beautiful rails sitemap plugin that talks to Google, Yahoo and MSN when updated. Sitemap features clean handcrafted XHTML, XML with XSLT and custom finder options for your named routes.
Clone URL: git://github.com/queso/sitemap.git
sitemap / lib / sitemap_static_links_controller.rb
100644 40 lines (31 sloc) 0.806 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class SitemapStaticLinksController < SitemapPluginController
  before_filter :find_static_link, :only => [:edit, :update, :destroy]
  
  def index
    @static_links = SitemapStaticLink.find(:all)
  end
  
  def edit
    
  end
  
  def update
    if @static_link.update_attributes(params[:sitemap_static_link])
      redirect_to sitemap_static_links_url
    end
  end
  
  def create
    @static_link = SitemapStaticLink.new(params[:sitemap_static_link])
    if @static_link.save
      redirect_to sitemap_static_links_url
    end
  end
  
  def new
    @static_link = SitemapStaticLink.new()
  end
  
  def destroy
    if @static_link.destroy
      redirect_to sitemap_static_links_url
    end
  end
  
  protected
  def find_static_link
    @static_link = SitemapStaticLink.find(params[:id])
  end
  
end