Class: WhurlEngine::ParameterDefinitionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/whurl_engine/parameter_definitions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
# File 'app/controllers/whurl_engine/parameter_definitions_controller.rb', line 7

def create
  @parameter_definition = WhurlEngine::ParameterDefinition.new(params[:parameter_definition])
  unless @parameter_definition.save
    render :partial => 'whurl_engine/shared/error', :locals => {:object => @parameter_definition}
  end
end

#destroyObject



25
26
27
28
29
30
# File 'app/controllers/whurl_engine/parameter_definitions_controller.rb', line 25

def destroy
  @parameter_definition = WhurlEngine::ParameterDefinition.find(params[:id])
  unless @parameter_definition.destroy
    render :partial => 'whurl_engine/shared/error', :locals => {:object => @parameter_definition}
  end
end

#editObject



14
15
16
# File 'app/controllers/whurl_engine/parameter_definitions_controller.rb', line 14

def edit
  @parameter_definition = WhurlEngine::ParameterDefinition.find(params[:id])
end

#newObject



3
4
5
# File 'app/controllers/whurl_engine/parameter_definitions_controller.rb', line 3

def new
  @parameter_definition = WhurlEngine::ParameterDefinition.new(:resource_id => params[:resource_id])
end

#updateObject



18
19
20
21
22
23
# File 'app/controllers/whurl_engine/parameter_definitions_controller.rb', line 18

def update
  @parameter_definition = WhurlEngine::ParameterDefinition.find(params[:id])
  unless @parameter_definition.update_attributes(params[:parameter_definition])
    render :partial => 'whurl_engine/shared/error', :locals => {:object => @parameter_definition}
  end
end