GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
technoweenie (author)
Sun Jan 01 14:29:40 -0800 2006
commit  182ae2f540ab94a7937c091972f203147bc331f2
tree    e3a26e4c6f63c4eca5fdf5c86c895fefad12d9ea
parent  6410b79f972227371dcd6e5584dfdb46a847a65d
mephisto / app / controllers / admin / templates_controller.rb
100644 24 lines (21 sloc) 0.751 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
class Admin::TemplatesController < Admin::BaseController
  before_filter :select_template, :except => :index
  verify :params => :id, :only => [:edit, :update],
         :add_flash => { :error => 'Template required' },
         :redirect_to => { :action => 'index' }
  verify :method => :post, :params => :template, :only => :update,
         :add_flash => { :error => 'Template required' },
         :redirect_to => { :action => 'edit' }
 
  def update
    if @tmpl.update_attributes(params[:template])
      flash[:notice] = "#{@tmpl.name} updated."
      redirect_to :action => 'edit', :id => @tmpl
    else
      render :action => 'edit'
    end
  end
 
  protected
  def select_template
    @tmpl = Template.find_by_name(params[:id])
  end
end