14 lines
266 B
Ruby
14 lines
266 B
Ruby
class Commands::UndosController < ApplicationController
|
|
before_action :set_command
|
|
|
|
def create
|
|
@command.undo!
|
|
redirect_back_or_to root_path
|
|
end
|
|
|
|
private
|
|
def set_command
|
|
@command = Current.user.commands.find(params[:command_id])
|
|
end
|
|
end
|