Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created January 30, 2012 20:21
Show Gist options
  • Save coderforhire/1706440 to your computer and use it in GitHub Desktop.
Save coderforhire/1706440 to your computer and use it in GitHub Desktop.
def create
@event = Event.new(params[:event])
respond_to do |format|
if @event.save
format.html { redirect_to @event, notice: 'Event was successfully created.' }
format.json { render json: @event, status: :created, location: @event }
else
format.html { render action: "new" }
format.json { render json: @event.errors, status: :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment