Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def create
  2. @institution = Institution.new(institution_params.except(:admin), as: :admin)
  3. if @institution.save_with_admin(login: institution_params[:admin]
  4. redirect_to admin_institutions_path, flash: {
  5. success: "Institution created."
  6. }
  7. else
  8. flash.now[:error] = 'Unable to create institution.'
  9. render :new
  10. end
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement