Class: Site::ClientsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Site::ClientsController
- Defined in:
- app/controllers/site/clients_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/site/clients_controller.rb', line 12 def create @client = Site::Client.new params[:site_client] if @client.save respond_to do |format| format.html { redirect_to edit_site_client_path(@client, step: 2) } end else respond_to do |format| format.html { render :new } end end end |
#destroy ⇒ Object
46 47 48 49 50 |
# File 'app/controllers/site/clients_controller.rb', line 46 def destroy @client.destroy redirect_to home_path end |
#edit ⇒ Object
28 29 30 |
# File 'app/controllers/site/clients_controller.rb', line 28 def edit @client = Site::Client.find params[:id] end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/site/clients_controller.rb', line 8 def index @clients = current_subject.managed_site_clients end |
#update ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/site/clients_controller.rb', line 32 def update @client = Site::Client.find params[:id] if @client.update_attributes params[:client] respond_to do |format| format.html { redirect_to @client } end else respond_to do |format| format.html { render :edit } end end end |