Created
May 8, 2014 11:00
-
-
Save dmgarland/a41f0fbf75f1edce0120 to your computer and use it in GitHub Desktop.
Starting point for a authors controlller...
This file contains 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
PadrinoBlog::App.controllers :authors do | |
get :new do | |
@author = Author.new | |
erb :'authors/new' | |
end | |
post :create do | |
@author = Author.new(params[:author]) | |
if @author.save | |
redirect '/' | |
else | |
flash[:notice] = "Sorry... there was a problem.." | |
erb :'authors/new' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment