class ActionsController

This class processes the web-side portion of things.

Public Instance Methods

create() click to toggle source

POST /actions POST /actions.json

# File app/controllers/actions_controller.rb, line 53
def create
  @action = Action.new(params[:action_data])

  respond_to do |format|
    if @action.save
      format.html { redirect_to @action, :notice => 'Action was successfully created.' }
      format.json { render :json => @action, :status => :created, :location => @action }
    else
      format.html { render :action => "new" }
      format.json { render :json => @action.errors, :status => :unprocessable_entity }
    end
  end
end
destroy() click to toggle source

DELETE /actions/1 DELETE /actions/1.json

# File app/controllers/actions_controller.rb, line 85
def destroy
  @action = Action.find(params[:id])
  @action.destroy

  respond_to do |format|
    format.html { redirect_to actions_url }
    format.json { head :ok }
  end
end
edit() click to toggle source

GET /actions/1/edit

# File app/controllers/actions_controller.rb, line 47
def edit
  @action = Action.find(params[:id])
end
index() click to toggle source

GET /actions GET /actions.json

# File app/controllers/actions_controller.rb, line 15
def index
  @actions = Action.all

  respond_to do |format|
    format.html # index.html.erb
    format.json { render :json => @actions }
  end
end
new() click to toggle source

GET /actions/new GET /actions/new.json

# File app/controllers/actions_controller.rb, line 37
def new
  @action = Action.new

  respond_to do |format|
    format.html # new.html.erb
    format.json { render :json => @action }
  end
end
show() click to toggle source

GET /actions/1 GET /actions/1.json

# File app/controllers/actions_controller.rb, line 26
def show
  @action = Action.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.json { render :json => @action }
  end
end
update() click to toggle source

PUT /actions/1 PUT /actions/1.json

# File app/controllers/actions_controller.rb, line 69
def update
  @action = Action.find(params[:id])

  respond_to do |format|
    if @action.update_attributes(params[:action])
      format.html { redirect_to @action, :notice => 'Action was successfully updated.' }
      format.json { head :ok }
    else
      format.html { render :action => "edit" }
      format.json { render :json => @action.errors, :status => :unprocessable_entity }
    end
  end
end