Sha256: eabc53282924b31691bb5b5988d42b15f4e3752a4393c04009bbee808271ad57
Contents?: true
Size: 664 Bytes
Versions: 1
Compression:
Stored size: 664 Bytes
Contents
class NormalPostsController < ApplicationController def show @post = Post.find(params[:id]) end def new @post = Post.new end def edit @post = Post.find(params[:id]) end def create @post = Post.new(post_params) if @post.save redirect_to [:normal, @post] else render :new end end def update @post = Post.find(params[:id]) if @post.update_attributes(post_params) redirect_to [:normal, @post] else render :edit end end private def post_params params.require(:post).permit(:title, :image, :image_cache_id, :document, :document_cache_id, :remove_document) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
refile-0.2.5 | spec/refile/test_app/app/controllers/normal_posts_controller.rb |