thingspeak/app/admin/channel.rb
2014-10-06 11:42:02 -04:00

26 lines
515 B
Ruby

ActiveAdmin.register Channel do
filter :name
filter :description
filter :created_at
permit_params :name, :public_flag
index do
column :id
column(:name) { |channel| link_to channel.name, channel }
column(:user) { |channel| link_to channel.user.login, admin_user_path(channel.user) if channel.user.present? }
column :public_flag
column :created_at
actions
end
form do |f|
f.semantic_errors *f.object.errors.keys
f.inputs :name, :public_flag
f.actions
end
end