Class: Pulitzer::PartialTagsController

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

Defined Under Namespace

Classes: CreatePartialTag

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
# File 'app/controllers/pulitzer/partial_tags_controller.rb', line 9

def create
  @partial_tag = CreatePartialTag.new(params).call
  render partial: 'show', locals: { partial: @partial_tag.partial, partial_tag: @partial_tag, tag_model: @partial_tag.label_type }
end

#newObject



2
3
4
5
6
7
# File 'app/controllers/pulitzer/partial_tags_controller.rb', line 2

def new
  @tag_model = params[:tag_model]
  @partial = Pulitzer::Partial.find params[:partial_id]
  @partial_tag = @partial.partial_tags.new label_type: @tag_model
  render partial: 'new', locals: { tag_model: @tag_model, partial_tag: @partial_tag, partial: @partial }
end