Guest User

Untitled

a guest
Apr 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. def create
  2. if request.post?
  3. formdata = params.fetch("organization")
  4. formdata['signupip'] = request.remote_ip
  5. organization = Organization.new(formdata)
  6. if organization.save
  7. Notifier::deliver_signup_thanks(organization)
  8. flash[:notice] = "Organization created! Your access key is: <strong>#{organization.access_key}</strong>. <br />This key has also been emailed to you at: #{organization.contact_email}</strong>."
  9. redirect_to :controller => 'home'
  10. else
  11. puts "not saved!!! :( :( :("
  12. flash[:error] = "<strong>There was an error while signing up your organization.</strong> <br />Please try again or contact us for <a href='/help'>assistance</a>."
  13. end
  14. end
  15. end
Add Comment
Please, Sign In to add comment