Class: Muck::PostsController

Inherits:
ContentsController
  • Object
show all
Defined in:
app/controllers/muck/posts_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
# File 'app/controllers/muck/posts_controller.rb', line 6

def index
  @posts = @blog.posts.by_newest
  respond_to do |format|
    format.html { render :template => 'posts/index', :layout => 'popup' }
    format.pjs { render :template => 'posts/index', :layout => false }
  end
end

#newObject



20
21
22
23
24
# File 'app/controllers/muck/posts_controller.rb', line 20

def new
  @content = @blog.posts.new()
  @new_content_message = t('muck.blogs.add_post')
  super
end

#showObject



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

def show
  @content = Content.find(params[:id], :scope => Content.contentable_to_scope(@blog)) if @blog
  @content ||= Content.find(params[:id])
  super
end