Sha256: 3b0abe019752802b31b648b49d5a7bb1d2cc7de6d4f15b9f0577c9b028324ff6

Contents?: true

Size: 1.77 KB

Versions: 5

Compression:

Stored size: 1.77 KB

Contents

class Manage::TrackableTagsController < Manage::ApplicationController
  skip_before_action :require_admin_or_limited_admin
  before_action :require_admin_or_limited_admin_or_event_tracking

  before_action :set_trackable_tag, only: [:show, :edit, :update, :destroy]

  respond_to :html, :json

  # GET /manage/trackable_tags
  def index
    @trackable_tags = TrackableTag.all
    respond_with(:manage, @trackable_tags)
  end

  # GET /manage/trackable_tags/1
  def show
    respond_with(:manage, @trackable_tag)
  end

  # GET /manage/trackable_tags/new
  def new
    @trackable_tag = TrackableTag.new
    respond_with(:manage, @questionnaire)
  end

  # GET /manage/trackable_tags/1/edit
  def edit
  end

  # POST /manage/trackable_tags
  def create
    @trackable_tag = TrackableTag.new(trackable_tag_params)

    if @trackable_tag.save
      flash[:notice] = 'Trackable tag was successfully created.'
      respond_with(:manage, @trackable_tag)
    else
      response_view_or_errors :new, @trackable_tag
    end
  end

  # PATCH/PUT /manage/trackable_tags/1
  def update
    if @trackable_tag.update(trackable_tag_params)
      flash[:notice] = 'Trackable tag was successfully updated.'
      respond_with(:manage, @trackable_tag)
    else
      response_view_or_errors :edit, @trackable_tag
    end
  end

  # DELETE /manage/trackable_tags/1
  def destroy
    @trackable_tag.destroy
    flash[:notice] = 'Trackable tag was successfully destroyed.'
    respond_with(:manage, @trackable_tag)
  end

  private

  # Use callbacks to share common setup or constraints between actions.
  def set_trackable_tag
    @trackable_tag = TrackableTag.find(params[:id])
  end

  # Only allow a trusted parameter "white list" through.
  def trackable_tag_params
    params.require(:trackable_tag).permit(:name)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hackathon_manager-0.13.5 app/controllers/manage/trackable_tags_controller.rb
hackathon_manager-0.13.4 app/controllers/manage/trackable_tags_controller.rb
hackathon_manager-0.13.3 app/controllers/manage/trackable_tags_controller.rb
hackathon_manager-0.13.2 app/controllers/manage/trackable_tags_controller.rb
hackathon_manager-0.13.1 app/controllers/manage/trackable_tags_controller.rb