Class: Backend::SearchSynonymsController

Inherits:
BaseController
  • Object
show all
Includes:
Concerns::PaginationController
Defined in:
app/controllers/backend/search_synonyms_controller.rb

Instance Method Summary collapse

Methods included from Concerns::PaginationController

#page_number, #paginate, #per_page

Methods inherited from BaseController

#breadcrumb, #current_admin, #default_app_locale, #translate_notice

Methods included from Udongo::Cryptography

#crypt

Instance Method Details

#createObject



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

def create
  @search_synonym = SearchSynonym.new(allowed_params)

  if @search_synonym.save
    redirect_to backend_search_synonyms_path, notice: translate_notice(:added, :search_synonym)
  else
    render :new
  end
end

#destroyObject



25
26
27
28
# File 'app/controllers/backend/search_synonyms_controller.rb', line 25

def destroy
  @search_synonym.destroy
  redirect_to backend_search_synonyms_path, notice: translate_notice(:deleted, :search_synonym)
end

#indexObject



7
8
9
# File 'app/controllers/backend/search_synonyms_controller.rb', line 7

def index
  @search_synonyms = paginate(SearchSynonym.all)
end

#newObject



11
12
13
# File 'app/controllers/backend/search_synonyms_controller.rb', line 11

def new
  @search_synonym = SearchSynonym.new
end

#updateObject



30
31
32
33
34
35
36
# File 'app/controllers/backend/search_synonyms_controller.rb', line 30

def update
  if @search_synonym.update_attributes allowed_params
    redirect_to backend_search_synonyms_path, notice: translate_notice(:edited, :search_synonym)
  else
    render :edit
  end
end