Sha256: d784d871f122898f75c6fddb1d94ffc9070e45e31e42fe84c050fae38190f502

Contents?: true

Size: 771 Bytes

Versions: 19

Compression:

Stored size: 771 Bytes

Contents

class Pulitzer::PostTagsController < Pulitzer::ApplicationController
  before_action :get_post_tag, only: [:destroy]

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

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

  def destroy
    @post_tag.destroy
    head :ok and return
  end

  protected

  def post_tag_params
    params[:post_tag].permit!
  end

  def get_post_tag
    @post_tag = Pulitzer::PostTag.find(params[:id])
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
pulitzer-0.15.31 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.30 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.29 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.28 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.27 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.26 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.25 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.24 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.23 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.22 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.21 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.20 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.19 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.18 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.17 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.16 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.15 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.14 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.15.13 app/controllers/pulitzer/post_tags_controller.rb