about summary refs log tree commit diff stats
path: root/data/maps/the_owl
diff options
context:
space:
mode:
Diffstat (limited to 'data/maps/the_owl')
-rw-r--r--data/maps/the_owl/metadata.txtpb1
1 files changed, 1 insertions, 0 deletions
diff --git a/data/maps/the_owl/metadata.txtpb b/data/maps/the_owl/metadata.txtpb new file mode 100644 index 0000000..a2004f8 --- /dev/null +++ b/data/maps/the_owl/metadata.txtpb
@@ -0,0 +1 @@
display_name: "The Owl"
46' href='#n46'>46 47 48 49 50 51 52































                                                     
                                


















                                                                                                          
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(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