Class: DependencyConditionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/dependency_conditions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /dependency_conditions POST /dependency_conditions.xml



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'app/controllers/dependency_conditions_controller.rb', line 43

def create
  @dependency_condition = DependencyCondition.new(params[:dependency_condition])

  respond_to do |format|
    if @dependency_condition.save
      flash[:notice] = 'DependencyCondition was successfully created.'
      format.html { redirect_to(@dependency_condition) }
      format.xml  { render :xml => @dependency_condition, :status => :created, :location => @dependency_condition }
    else
      format.html { render :action => "new" }
      format.xml  { render :xml => @dependency_condition.errors, :status => :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /dependency_conditions/1 DELETE /dependency_conditions/1.xml



77
78
79
80
81
82
83
84
85
# File 'app/controllers/dependency_conditions_controller.rb', line 77

def destroy
  @dependency_condition = DependencyCondition.find(params[:id])
  @dependency_condition.destroy

  respond_to do |format|
    format.html { redirect_to(dependency_conditions_url) }
    format.xml  { head :ok }
  end
end

#editObject

GET /dependency_conditions/1/edit



37
38
39
# File 'app/controllers/dependency_conditions_controller.rb', line 37

def edit
  @dependency_condition = DependencyCondition.find(params[:id])
end

#indexObject

GET /dependency_conditions.xml



5
6
7
8
9
10
11
12
# File 'app/controllers/dependency_conditions_controller.rb', line 5

def index
  @dependency_conditions = DependencyCondition.find(:all)

  respond_to do |format|
    format.html # index.html.erb
    format.xml  { render :xml => @dependency_conditions }
  end
end

#newObject

GET /dependency_conditions/new GET /dependency_conditions/new.xml



27
28
29
30
31
32
33
34
# File 'app/controllers/dependency_conditions_controller.rb', line 27

def new
  @dependency_condition = DependencyCondition.new

  respond_to do |format|
    format.html # new.html.erb
    format.xml  { render :xml => @dependency_condition }
  end
end

#showObject

GET /dependency_conditions/1 GET /dependency_conditions/1.xml



16
17
18
19
20
21
22
23
# File 'app/controllers/dependency_conditions_controller.rb', line 16

def show
  @dependency_condition = DependencyCondition.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.xml  { render :xml => @dependency_condition }
  end
end

#updateObject

PUT /dependency_conditions/1 PUT /dependency_conditions/1.xml



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'app/controllers/dependency_conditions_controller.rb', line 60

def update
  @dependency_condition = DependencyCondition.find(params[:id])

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