Sha256: bc478aaa4f4ebdf9ab2aa37be5b3543b568b805aab1f2cd37a7d152de4e955f0
Contents?: true
Size: 827 Bytes
Versions: 18
Compression:
Stored size: 827 Bytes
Contents
module Pageflow module ExternalLinks class SitesController < ActionController::Base respond_to :json def index @entry = Entry.find(params[:entry_id]) respond_with(Site.all_for_revision(@entry.draft)) end def create @entry = Entry.find(params[:entry_id]) site = Site.all_for_revision(@entry.draft).create!(site_params) respond_with(site) end def update site = Site.find(params[:id]) site.update(site_params) respond_with(site) end def destroy site = Site.find(params[:id]) site.destroy respond_with(site) end protected def site_params params.require(:site).permit(:url, :thumbnail, :title, :description, :open_in_new_tab) end end end end
Version data entries
18 entries across 18 versions & 2 rubygems