Class: WcoHosting::DomainsController
- Inherits:
-
ApplicationController
- Object
- Wco::ApplicationController
- ApplicationController
- WcoHosting::DomainsController
- Defined in:
- app/controllers/wco_hosting/domains_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/wco_hosting/domains_controller.rb', line 4 def create @domain = WcoHosting::Domain.new params[:domain].permit! :create, @domain if @domain.save flash_notice @domain else flash_alert @domain end redirect_to action: :index end |
#edit ⇒ Object
17 18 19 20 |
# File 'app/controllers/wco_hosting/domains_controller.rb', line 17 def edit @domain = WcoHosting::Domain.find params[:id] :edit, @domain end |
#index ⇒ Object
22 23 24 25 |
# File 'app/controllers/wco_hosting/domains_controller.rb', line 22 def index :index, WcoHosting::Domain @domains = WcoHosting::Domain.all end |
#new ⇒ Object
28 29 30 31 |
# File 'app/controllers/wco_hosting/domains_controller.rb', line 28 def new @domain = WcoHosting::Domain.new :new, @domain end |
#show ⇒ Object
33 34 35 36 37 |
# File 'app/controllers/wco_hosting/domains_controller.rb', line 33 def show @domain = WcoHosting::Domain.find params[:id] :show, @domain @subdomains = WcoHosting::Appliance.where( domain: @domain.name ).map( &:subdomain ) end |
#update ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'app/controllers/wco_hosting/domains_controller.rb', line 44 def update @domain = WcoHosting::Domain.find params[:id] :update, @domain if @domain.update_attributes( params[:domain].permit! ) flash_notice @domain else flash_alert @domain end redirect_to action: :index end |