app/controllers/form_creation/posts_controller.rb
# POST method for processing form data   
POST method for processing form data
POST method for processing form data
def create   
      @post = Post.new(post_params)
      if @post.save 
        flash[:notice] = 'Post added!'   
        redirect_to posts_path   
      else
        flash[:error] = 'Failed to edit Post!'   
        render :new
      end   
    end
def create @post = Post . new ( post_params ) if @post . save flash [ :notice ] = 'Post added!' redirect_to posts_path else flash [ :error ] = 'Failed to edit Post!' render :new end end
POST method for processing form data
POST method for processing form data