Created
September 10, 2012 18:28
-
-
Save pdtpatrick/3692751 to your computer and use it in GitHub Desktop.
controller_sharing
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
class PoliciesController < ApplicationController | |
def new | |
@policy = Policy.new | |
end | |
def create | |
@policy = Policy.new(params[:policy]) | |
# save policy | |
if @policy.save | |
flash[:notice_success] = "Form sent." | |
redirect_to(:action => 'new') | |
else | |
#if failed do | |
# render('new') | |
flash[:notice_fail] = "Please fix errors" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment