diff options
author | Ben Harris <ben@tilde.team> | 2022-01-15 12:32:36 -0500 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2022-01-15 12:32:36 -0500 |
commit | 1d9a622303d7ef6c2f1db99d759554c268767cc4 (patch) | |
tree | fa6cdede34fb43efe104ea531bb4c53e04f364e9 /app/controllers/machines_controller.rb | |
parent | 2c8c227493509175fcdbcba3e6a85f8b954a169e (diff) |
remove edit.html.erb
Diffstat (limited to 'app/controllers/machines_controller.rb')
-rw-r--r-- | app/controllers/machines_controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/machines_controller.rb b/app/controllers/machines_controller.rb index d83a52f..3ef5893 100644 --- a/app/controllers/machines_controller.rb +++ b/app/controllers/machines_controller.rb @@ -5,7 +5,7 @@ class MachinesController < ApplicationController # GET /machines or /machines.json def index - @machines = Machine.all + @machines = Machine.order(:name) end # GET /machines/1 or /machines/1.json @@ -25,7 +25,7 @@ class MachinesController < ApplicationController respond_to do |format| if @machine.save - format.html { redirect_to machine_url(@machine), notice: 'Machine was successfully created.' } + format.html { redirect_to machines_url, notice: 'Machine was successfully created.' } format.json { render :show, status: :created, location: @machine } else format.html { render :new, status: :unprocessable_entity } @@ -38,10 +38,10 @@ class MachinesController < ApplicationController def update respond_to do |format| if @machine.update(machine_params) - format.html { redirect_to machine_url(@machine), notice: 'Machine was successfully updated.' } + format.html { redirect_to machines_url, notice: 'Machine was successfully updated.' } format.json { render :show, status: :ok, location: @machine } else - format.html { render :edit, status: :unprocessable_entity } + format.html { render :show, status: :unprocessable_entity } format.json { render json: @machine.errors, status: :unprocessable_entity } end end |