Class: Pulitzer::PostTagsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pulitzer/post_tags_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
# File 'app/controllers/pulitzer/post_tags_controller.rb', line 11

def create
  @post_tag = Pulitzer::CreatePostTag.new(params).call
  render partial: 'show', locals: { version: @post_tag.version, tag_model: @post_tag.label_type }
end

#destroyObject



16
17
18
19
# File 'app/controllers/pulitzer/post_tags_controller.rb', line 16

def destroy
  @post_tag.destroy
  render nothing: true
end

#newObject



4
5
6
7
8
9
# File 'app/controllers/pulitzer/post_tags_controller.rb', line 4

def new
  @tag_model = params[:tag_model]
  @version = Pulitzer::Version.find params[:version_id]
  @post_tag = @version..new label_type: @tag_model
  render partial: 'new', locals: { tag_model: @tag_model, post_tag: @post_tag }
end