about summary refs log tree commit diff stats
path: root/data/maps/control_center/rooms/Entry Entrance.txtpb
blob: d9205231566dd3988f5b9b7d57d10afd866c87e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
name: "Entry Entrance"
panels {
  name: "ENTRY"
  path: "Panels/Hallway Right/entry_3"
  clue: "entry"
  answer: "exit"
  symbols: SUN
}
ports {
  name: "ENTRY"
  path: "Components/Warps/worldport2"
}
*/ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
class Admin::LinksController < Admin::AdminController
  before_action :set_section

  def index
    @links = Link.order(created_at: :desc)
  end

  def new
    @link = Link.new
  end

  def create
    @link = Link.new(link_params)

    if @link.save
      flash.notice = "Link created successfully!"

      render :edit
    else
      flash.alert = "Error creating link."

      render :new
    end
  end

  def edit
    @link = Link.find(params[:id])
  end

  def update
    @link = Link.find(params[:id])

    if @link.update_attributes(link_params)
      flash.notice = "Link updated successfully!"
    else
      flash.alert = "Error updating link."
    end

    render :edit
  end

  private

    def link_params
      params.require(:link).permit(:title, :url, :tag_list, records_attributes: [:description, :_destroy])
    end

    def set_section
      @section = "links"
    end

end