Sha256: b9f8a3af3b1d336891b12959a1776a83968888d13582e2b2b099e00040251d71

Contents?: true

Size: 772 Bytes

Versions: 55

Compression:

Stored size: 772 Bytes

Contents

class Pulitzer::PostTagsController < Pulitzer::ApplicationController
  before_filter :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
    render nothing: true
  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

55 entries across 55 versions & 1 rubygems

Version Path
pulitzer-0.12.5 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.12.4 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.12.3 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.12.2 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.12.1 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.12.0 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.11.3 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.11.2 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.11.1 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.11.0 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.10.3 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.10.2 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.10.1 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.10.0 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.14 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.13 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.11 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.10 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.9 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.8 app/controllers/pulitzer/post_tags_controller.rb