Skip to content

Instantly share code, notes, and snippets.

@flaneur2020
Last active August 29, 2015 14:06
Show Gist options
  • Save flaneur2020/55aff1179777846b950f to your computer and use it in GitHub Desktop.
Save flaneur2020/55aff1179777846b950f to your computer and use it in GitHub Desktop.
def new
@form = flash[:new_fund_password_form] || NewFundPasswordForm.new
end
def create
@form = NewFundPasswordForm.new(new_fund_password_params)
if @form.save
flash[:notice] = I18n.t('fund_passwords.new.success')
redirect_to account_path
else
flash[:new_fund_password_form] = @form
redirect_to new_account_fund_password_path
end
end
def new
@form = NewFundPasswordForm.new
end
def create
@form = NewFundPasswordForm.new(new_fund_password_params)
if @form.save
flash[:notice] = I18n.t('fund_passwords.new.success')
redirect_to account_path
else
render :new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment