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.5.7 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.6 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.5 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.4 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.3 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.2 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.1 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.5.0 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.16 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.15 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.14 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.13 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.12 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.11 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.10 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.9 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.8 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.7 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.6 app/controllers/pulitzer/post_tags_controller.rb
pulitzer-0.4.5 app/controllers/pulitzer/post_tags_controller.rb