Sha256: ddb5b9e5a1615973453309f63d49c1a5ea80a518c3d0384a12ed91c6973b6a08
Contents?: true
Size: 525 Bytes
Versions: 9
Compression:
Stored size: 525 Bytes
Contents
class PostsController < InheritedResources::Base load_and_authorize_resource def edit @post = Post.find(params[:id]) render "comments/edit" end def create @post = Post.new(params[:post]) @post.user =current_user if @post.save redirect_to(@post.comment.commentable, :notice => 'Post was successfully created.') else redirect_to :back flash[:error]="Completa todos los datos" end end def destroy @post.destroy redirect_to @post.comment.commentable end end
Version data entries
9 entries across 8 versions & 1 rubygems