Class: Write::PostsController

Inherits:
ApplicationController show all
Includes:
ApplicationHelper
Defined in:
app/controllers/write/posts_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#write_admin?

Instance Method Details

#indexObject



7
8
9
10
# File 'app/controllers/write/posts_controller.rb', line 7

def index
  GG.fetch if GG.empty?
  @posts = GG.all
end

#refreshObject



14
15
16
17
18
19
20
# File 'app/controllers/write/posts_controller.rb', line 14

def refresh
  if write_admin?
    GG.clear!
    GG.fetch
  end
  redirect_to :action => :index
end

#showObject



11
12
13
# File 'app/controllers/write/posts_controller.rb', line 11

def show
  @post = GG.find params[:code]
end