Class: Boss::Admin::BannersController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/boss/admin/banners_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/boss/admin/banners_controller.rb', line 9

def create
  @banner = Boss::Banner.new(params[:banner])
  if @banner.save
    flash[:notice] = t('banners.flash.saved')
    redirect_to main_app.admin_root_path
  else
    flash[:alert] = t('banners.flash.failed_to_save')
    render :new
  end
end

#newObject



4
5
6
7
# File 'app/controllers/boss/admin/banners_controller.rb', line 4

def new
  @banner = Boss::Banner.new
  @banner.build_image
end