Sha256: 55c8b8b57ce0c394cc7d138777a773d36f4f5dde61048bc67100fda66ef536aa
Contents?: true
Size: 1.33 KB
Versions: 1
Compression:
Stored size: 1.33 KB
Contents
module Txtblx if defined?(ActiveAdmin) ActiveAdmin.register Textblock, as: 'Textblock' do actions :all, except: [:destroy] index do column :key do |textblock| link_to(textblock.key, admin_textblock_path(textblock)) end column :description end show do |textblock| div :class => :columns do attributes_table_for textblock do row :key row :description row :text end end end form do |f| f.inputs :key, :description, :text f.actions do f.action :submit f.action :cancel, as: :link, button_html: {class: 'button'} end end controller do def permitted_params params.permit(:utf8, :_method, :authenticity_token, :commit, :id, textblock: [:key, :perma_id, :description, :text]) end def update result = super resource.publish if resource.valid? result end def create result = super resource.publish if resource.valid? result end def find_resource Textblock.drafts.where(perma_id: params[:id]).first! end def scoped_collection Textblock.drafts end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
txtblx-0.0.1 | lib/txtblx/admin/textblocks.rb |