Sha256: 343c0d31f0b1f9fc7f406c226523b267cb18986347f3c0429f1cb52d2e057229
Contents?: true
Size: 1.08 KB
Versions: 2
Compression:
Stored size: 1.08 KB
Contents
module Wafflemix class PostsController < ApplicationController before_filter :find_page def index @posts = Post.published @tags = Post.tag_counts_on(:tags) respond_to do |format| format.html format.json { render json: @posts } end end def show @post = Post.find(params[:id]) @tags = Post.tag_counts_on(:tags) respond_to do |format| format.html format.json { render json: @post } end end def mercury_update post = Post.find(params[:id]) post.title = params[:content][:post_title][:value] post.body = params[:content][:post_body][:value] post.excerpt = params[:content][:post_excerpt][:value] post.save! render text: "" end def tagged @posts = Post.published.tagged_with(params[:id]) @tags = @posts.tag_counts_on(:tags) respond_to do |format| format.html format.json { render json: @posts } end end private def find_page @page = Page.find_by_title("Blog") end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
wafflemix-0.0.6 | app/controllers/wafflemix/posts_controller.rb |
wafflemix-0.0.5 | app/controllers/wafflemix/posts_controller.rb |