Project

General

Profile

« Previous | Next » 

Revision 55ed30c7

Added by Ohad Levy about 14 years ago

  • ID 55ed30c719e32dfe3604895ade33b466affeafa3

fixes #194 - remove activescaffold from partitioning table setting page

View differences:

app/controllers/ptables_controller.rb
class PtablesController < ApplicationController
active_scaffold :ptable do |config|
config.label = "Partition tables"
config.list.columns = [:name ]
config.columns = %w{ name layout }
config.columns[:layout].description = "The partition layout you would like to use"
config.nested.add_link("Hosts", [:hosts])
config.nested.add_link("Operating systems", [:operatingsystems])
def index
@ptables = Ptable.all
end
def show
@ptable = Ptable.find(params[:id])
end
def new
@ptable = Ptable.new
end
def create
@ptable = Ptable.new(params[:ptable])
if @ptable.save
flash[:foreman_notice] = "Successfully created partition table."
redirect_to @ptable
else
render :action => 'new'
end
end
def edit
@ptable = Ptable.find(params[:id])
end
def update
@ptable = Ptable.find(params[:id])
if @ptable.update_attributes(params[:ptable])
flash[:foreman_notice] = "Successfully updated partition table."
redirect_to @ptable
else
render :action => 'edit'
end
end
def destroy
@ptable = Ptable.find(params[:id])
@ptable.destroy
flash[:foreman_notice] = "Successfully destroyed partition table."
redirect_to ptables_url
end
end

Also available in: Unified diff