Sha256: d73b6e513bc3a9c0e863ffe6c481c0ea04ac0750259ccc143f664b8152ce0c21

Contents?: true

Size: 809 Bytes

Versions: 2

Compression:

Stored size: 809 Bytes

Contents

#coding: utf-8

class Redditor::Admin::TextBlocksController < Redditor::Admin::BaseController
  def new
    @content_block = @page.text_blocks.build(content_block_params)
    render "redditor/admin/new"
  end

  def update
    @content_block = @page.text_blocks.find(params[:id])
    @content_block.update_attributes(content_block_params)
    render "redditor/admin/wrapper"
  end

  def create
    @content_block = @page.text_blocks.build(content_block_params)
    @content_block.save
    render "redditor/admin/wrapper"
  end

  def destroy
    @content_block = @page.text_blocks.find(params[:id])
    if @content_block.destroy
      render js: "$('#text_block_#{@content_block.id}').closest('dd').remove();"
    else
      render js: "alert('Контент-блок не удален');"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redditor-0.1.22 app/controllers/redditor/admin/text_blocks_controller.rb
redditor-0.1.20 app/controllers/redditor/admin/text_blocks_controller.rb