Skip to content

Instantly share code, notes, and snippets.

@zetavg
Last active August 29, 2015 14:05
Show Gist options
  • Save zetavg/a27d1649f38e081b5763 to your computer and use it in GitHub Desktop.
Save zetavg/a27d1649f38e081b5763 to your computer and use it in GitHub Desktop.
ActiveAdmin rails-settings-cached
ActiveAdmin.register_page "Preference" do
menu priority: 2
content do
panel "Preference" do
form :action => admin_preference_update_path, :method => :post do |f|
fieldset do
ol do
li do
label 'dfg'
f.input :name => 'key', :type => 'text'
end
end
end
end
end
end
page_action :update, :method => :post do
asdf
Preference[params[:key]] = params[:val]
redirect_to :back, :notice => "#{params[:key]} added"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment