Skip to content

Instantly share code, notes, and snippets.

@buethling
Created June 10, 2011 02:44
Show Gist options
  • Save buethling/1018154 to your computer and use it in GitHub Desktop.
Save buethling/1018154 to your computer and use it in GitHub Desktop.
1 class PhrasesController < ApplicationController
2 before_filter :authenticate, :only => [:create, :destroy]
3
4 def create
5 @phrase = @story.phrases.build(params[:phrase])
6 if @phrase.save
7 flash[:success] = "Micropost created!"
8 redirect_to @story
9 else
10 render 'pages/home'
11 end
12 end
13
14 def destroy
15
16 end
17 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment