Created
June 27, 2015 20:35
-
-
Save amixpal/4d9b6f727a575381665b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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