Created
January 30, 2012 20:21
-
-
Save coderforhire/1706440 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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