Class: BrowsersController

Inherits:
AdminController show all
Defined in:
app/controllers/browsers_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

post /browsers



11
12
13
14
15
16
17
18
# File 'app/controllers/browsers_controller.rb', line 11

def create
  @entity = Browser.new entity_parameters
  if @entity.save
    form_processed_ok(admin_browser_path(id: @entity.id))
  else
    form_processed_with_error(:new)
  end
end

#destroyObject

delete /browsers/:id



34
35
36
37
38
39
# File 'app/controllers/browsers_controller.rb', line 34

def destroy
  if @entity.update! deleted: true
    flash[:notice] = t('browsers.destroy.success')
  end
  redirect_to admin_browsers_path
end

#editObject

get /browsers/:id/edit



21
22
# File 'app/controllers/browsers_controller.rb', line 21

def edit
end

#newObject

get /browsers/new



6
7
8
# File 'app/controllers/browsers_controller.rb', line 6

def new
  @entity = Browser.new
end

#updateObject

patch /browsers/:id



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

def update
  if @entity.update entity_parameters
    form_processed_ok(admin_browser_path(id: @entity.id))
  else
    form_processed_with_error(:edit)
  end
end