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

#login_user, #timestamp_display, #write_admin?

Instance Method Details

#fetchObject



21
22
23
# File 'app/controllers/write/posts_controller.rb', line 21

def fetch
  GG.fetch if GG.empty?
end

#indexObject



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

def index
  @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[:year], params[:code]
end