Class: DomainController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- DomainController
- Includes:
- DomainSystem
- Defined in:
- app/controllers/domain_controller.rb
Instance Method Summary collapse
Instance Method Details
#login ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/domain_controller.rb', line 4 def login case request.method when :post if session[:domain] = Domain.authenticate(params[:domain_name], params[:domain_password]) flash['notice'] = "Login successful" redirect_back_or_default :action => "welcome" else flash.now['notice'] = "Login unsuccessful" @login = params[:domain_login] end end end |
#logout ⇒ Object
29 30 31 |
# File 'app/controllers/domain_controller.rb', line 29 def logout session[:domain] = nil end |
#signup ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/domain_controller.rb', line 19 def signup @domain = Domain.new(params[:domain]) if request.post? and @domain.save session[:domain] = Domain.authenticate(@domain.name, params[:domain][:password]) flash['notice'] = "Signup successful" redirect_back_or_default :action => "welcome" end end |
#welcome ⇒ Object
33 34 |
# File 'app/controllers/domain_controller.rb', line 33 def welcome end |