Class: ForemanHosts::SyhostmodeldetailsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /syhostmodeldetails POST /syhostmodeldetails.json



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/controllers/foreman_hosts/syhostmodeldetails_controller.rb', line 41

def create
  @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.new(params[:foreman_hosts_syhostmodeldetail])

  respond_to do |format|
    if @syhostmodeldetail.save
      format.html { redirect_to @syhostmodeldetail, notice: 'syhostmodeldetail was successfully created.' }
      format.json { render json: @syhostmodeldetail, status: :created, location: @syhostmodeldetail }
    else
              format.html { render action: "new" }
      format.json { render json: @syhostmodeldetail.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /syhostmodeldetails/1 DELETE /syhostmodeldetails/1.json



73
74
75
76
77
78
79
80
81
82
# File 'app/controllers/foreman_hosts/syhostmodeldetails_controller.rb', line 73

def destroy
  @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.find(params[:id])
  @syhostmodeldetail.destroy
  respond_to do |format|
    format.html { redirect_to foreman_hosts_syhostmodeldetails_url }
    format.json { head :no_content }
  end


end

#editObject

GET /syhostmodeldetails/1/edit



35
36
37
# File 'app/controllers/foreman_hosts/syhostmodeldetails_controller.rb', line 35

def edit
  @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.find(params[:id])
end

#indexObject

GET /syhostmodeldetails GET /syhostmodeldetails.json



4
5
6
7
8
9
10
11
# File 'app/controllers/foreman_hosts/syhostmodeldetails_controller.rb', line 4

def index
  @syhostmodeldetails = ForemanHosts::Syhostmodeldetail.all.paginate(:page => params[:page])

  respond_to do |format|
    format.html # index.html.erb
    format.json { render json: @syhostmodeldetails }
  end
end

#newObject

GET /syhostmodeldetails/new GET /syhostmodeldetails/new.json



26
27
28
29
30
31
32
# File 'app/controllers/foreman_hosts/syhostmodeldetails_controller.rb', line 26

def new
  @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.new
  respond_to do |format|
    format.html # new.html.erb
    format.json { render json: @syhostmodeldetail }
  end
end

#showObject

GET /syhostmodeldetails/1 GET /syhostmodeldetails/1.json



15
16
17
18
19
20
21
22
# File 'app/controllers/foreman_hosts/syhostmodeldetails_controller.rb', line 15

def show
  @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @syhostmodeldetail }
  end
end

#updateObject

PUT /syhostmodeldetails/1 PUT /syhostmodeldetails/1.json



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'app/controllers/foreman_hosts/syhostmodeldetails_controller.rb', line 57

def update
  @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.find(params[:id])

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