Skip to content

Instantly share code, notes, and snippets.

@amixpal
Created June 27, 2015 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amixpal/4d9b6f727a575381665b to your computer and use it in GitHub Desktop.
Save amixpal/4d9b6f727a575381665b to your computer and use it in GitHub Desktop.
class SimulationsController < ApplicationController
def index
@simulations = Simulation.all
end
def new
end
def create
@simulation = Simulation.new(simulation_params)
@simulation.save
redirect_to @simulation
end
def show
@simulation = Simulation.find(params[:id])
end
def update
# This can be used for updating the next state transition.
# This action should be asynchronous
end
def destroy
# This action should be asynchronous.
end
private
def simulation_params
params.require(:simulation).permit(:name, :row, :col, :is_random)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment