Class: Admin::NoticesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/wechat/admin/notices_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



14
15
16
17
18
19
20
# File 'app/controllers/wechat/admin/notices_controller.rb', line 14

def create
  @notice = @template.notices.build(notice_params)

  unless @notice.save
    render :new, locals: { model: @notice }, status: :unprocessable_entity
  end
end

#indexObject



6
7
8
# File 'app/controllers/wechat/admin/notices_controller.rb', line 6

def index
  @notices = @template.notices.page(params[:page])
end

#newObject



10
11
12
# File 'app/controllers/wechat/admin/notices_controller.rb', line 10

def new
  @notice = @template.notices.build
end