Class: SearchEnginesController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /search_engines POST /search_engines.json



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

def create
  @search_engine = SearchEngine.new(search_engine_params)

  respond_to do |format|
    if @search_engine.save
      format.html { redirect_to @search_engine, notice: t('controller.successfully_created', model: t('activerecord.models.search_engine')) }
      format.json { render json: @search_engine, status: :created, location: @search_engine }
    else
      format.html { render action: "new" }
      format.json { render json: @search_engine.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /search_engines/1 DELETE /search_engines/1.json



75
76
77
78
79
80
81
82
# File 'app/controllers/search_engines_controller.rb', line 75

def destroy
  @search_engine.destroy

  respond_to do |format|
    format.html { redirect_to search_engines_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.search_engine')) }
    format.json { head :no_content }
  end
end

#editObject

GET /search_engines/1/edit



35
36
# File 'app/controllers/search_engines_controller.rb', line 35

def edit
end

#indexObject

GET /search_engines GET /search_engines.json



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

def index
  @search_engines = SearchEngine.all

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

#newObject

GET /search_engines/new GET /search_engines/new.json



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

def new
  @search_engine = SearchEngine.new

  respond_to do |format|
    format.html # new.html.erb
    format.json { render json: @search_engine }
  end
end

#showObject

GET /search_engines/1 GET /search_engines/1.json



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

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

#updateObject

PUT /search_engines/1 PUT /search_engines/1.json



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'app/controllers/search_engines_controller.rb', line 56

def update
  if params[:move]
    move_position(@search_engine, params[:move])
    return
  end

  respond_to do |format|
    if @search_engine.update_attributes(search_engine_params)
      format.html { redirect_to @search_engine, notice: t('controller.successfully_updated', model: t('activerecord.models.search_engine')) }
      format.json { head :no_content }
    else
      format.html { render action: "edit" }
      format.json { render json: @search_engine.errors, status: :unprocessable_entity }
    end
  end
end