Last active
August 29, 2015 14:05
Revisions
-
neson revised this gist
Aug 31, 2014 . 1 changed file with 0 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,13 +22,6 @@ end f.input :type => 'submit', :value => 'Add' end end page_action :update, :method => :post do -
neson revised this gist
Aug 31, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,9 @@ end li do label 'ddd' f.textarea :name => "data[ddd]" do Preference.ddd end end end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,11 +9,11 @@ ol do li do label 'dfg' f.input :name => "data[dfg]", :type => 'text', :value => Preference.dfg end li do label 'ddd' f.textarea :name => "data[ddd]", :value => Preference.ddd end end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,11 +9,11 @@ ol do li do label 'dfg' f.input :name => "data['dfg']", :type => 'text', :value => Preference['dfg'] end li do label 'ddd' f.textarea :name => "data['ddd']", :value => Preference['ddd'] end end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,8 +30,9 @@ end page_action :update, :method => :post do params['data'].each do |k, v| Preference[k] = v end redirect_to :back, :notice => "#{params[:key]} added" end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,11 +9,11 @@ ol do li do label 'dfg' f.input :name => 'data[dfg]', :type => 'text' end li do label 'ddd' f.textarea :name => 'data[ddd]' end end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,7 @@ content do form :action => admin_preference_update_path, :method => :post do |f| f.input :name => 'authenticity_token', :type => :hidden, :value => form_authenticity_token.to_s panel "Preference" do fieldset do ol do -
neson revised this gist
Aug 31, 2014 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ menu priority: 2 content do form :action => admin_preference_update_path, :method => :post do |f| panel "Preference" do fieldset do ol do li do @@ -17,6 +17,7 @@ end end end f.input :type => 'submit', :value => 'Add' end @@ -25,8 +26,6 @@ end page_action :update, :method => :post do -
neson revised this gist
Aug 31, 2014 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,11 @@ ol do li do label 'dfg' f.input :name => 'dfg', :type => 'text' end li do label 'ddd' f.textarea :name => 'ddd' end end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 3 additions and 31 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ content do panel "Preference" do form :action => admin_preference_update_path, :method => :post do |f| fieldset do ol do li do @@ -16,46 +16,18 @@ end end page_action :update, :method => :post do asdf Preference[params[:key]] = params[:val] redirect_to :back, :notice => "#{params[:key]} added" end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ panel "Preference" do form do |f| fieldset do ol do li do label 'dfg' -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ panel "Preference" do form do |f| fieldset ol do li do label 'dfg' -
neson revised this gist
Aug 31, 2014 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,10 +4,12 @@ panel "Preference" do form do |f| fieldset :class => 'inputs' do ol do li do label 'dfg' f.input :name => 'key', :type => 'text' end end end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 23 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,19 @@ ActiveAdmin.register_page "Preference" do menu priority: 2 content do panel "Preference" do form do |f| ol do li do label 'dfg' f.input :name => 'key', :type => 'text' end end end end form do |f| fieldset :class => 'inputs' do legend 'll' @@ -17,6 +30,16 @@ end end page_action :create, :method => :post do -
neson revised this gist
Aug 31, 2014 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,13 @@ content do form do |f| fieldset :class => 'inputs' do legend 'll' ol do li do label 'dfg' f.input :name => 'key' end end end fieldset :class => 'actions' do f.input :type => 'submit', :value => 'Submit' -
neson revised this gist
Aug 31, 2014 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,15 +2,14 @@ menu priority: 2 content do form do |f| fieldset :class => 'inputs' do f.input :name => 'key' f.input :name => 'val' end fieldset :class => 'actions' do f.input :type => 'submit', :value => 'Submit' end end end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ menu priority: 2 content do form do |f| div :class => 'inputs' do f.input :name => 'key' f.input :name => 'val' end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 32 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,38 +12,7 @@ end page_action :create, :method => :post do -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ menu priority: 2 content do form do |f| div :class => 'inputs', "Details" do f.input :name => 'key' f.input :name => 'val' end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ menu priority: 2 content do form do |f| div{:class => 'inputs'} "Details" do f.input :name => 'key' f.input :name => 'val' end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ menu priority: 2 content do form do |f| div{:class =? 'inputs'} "Details" do f.input :name => 'key' f.input :name => 'val' end -
neson revised this gist
Aug 31, 2014 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ ActiveAdmin.register_page "Preference" do menu priority: 2 content do form do |f| div{class: 'inputs'} "Details" do f.input :name => 'key' f.input :name => 'val' end end # panel "Preference" do -
neson revised this gist
Aug 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ ActiveAdmin.register_page "Preference" do menu priority: 2 content do form_for Preference.new do |f| inputs "Details" do input :name => 'key' input :name => 'val' -
neson revised this gist
Aug 31, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ menu priority: 2 content do form do |f| inputs "Details" do input :name => 'key' input :name => 'val' end end # panel "Preference" do -
neson revised this gist
Aug 31, 2014 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,17 @@ ActiveAdmin.register_page "Preference" do menu priority: 2 content do form do |f| f.inputs "Details" do f.input :name => 'key' f.input :name => 'val' end end # panel "Preference" do # end panel "Preference" do table do thead do -
neson created this gist
Aug 31, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ ActiveAdmin.register_page "Preference" do menu priority: 2 content do panel "Preference" do table do thead do th 'Setting' th 'Value' th '' end Preference.get_all.each do |key, val| tr do td strong key td val td do link_to "delete", admin_preference_delete_path( :key => key ), :method => :post end end end tr do form :action => admin_preference_create_path, :method => :post do |f| f.input :name => 'authenticity_token', :type => :hidden, :value => form_authenticity_token.to_s td do f.input :name => 'key' end td do f.input :name => 'val' end td do f.input :type => 'submit', :value => 'Add' end end end end end end page_action :create, :method => :post do Preference[params[:key]] = params[:val] redirect_to :back, :notice => "#{params[:key]} added" end page_action :create, :method => :post do Preference[params[:key]] = params[:val] redirect_to :back, :notice => "#{params[:key]} added" end page_action :delete, :method => :post do Preference.destroy params[:key] redirect_to :back, :notice => "#{params[:key]} deleted" end end