Skip to content
This repository was archived by the owner on Jun 19, 2018. It is now read-only.

Commit 0c522b2

Browse files
committed
init
0 parents  commit 0c522b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1372
-0
lines changed

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore the default SQLite database.
11+
/db/*.sqlite3
12+
/db/*.sqlite3-journal
13+
14+
# Ignore all logfiles and tempfiles.
15+
/log/*
16+
!/log/.keep
17+
/tmp

Gemfile

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'activeadmin', github: 'activeadmin'
4+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5+
gem 'rails', '4.2.0'
6+
# Use sqlite3 as the database for Active Record
7+
gem 'sqlite3'
8+
# Use SCSS for stylesheets
9+
gem 'sass-rails', '~> 5.0'
10+
# Use Uglifier as compressor for JavaScript assets
11+
gem 'uglifier', '>= 1.3.0'
12+
# Use CoffeeScript for .coffee assets and views
13+
gem 'coffee-rails', '~> 4.1.0'
14+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
15+
# gem 'therubyracer', platforms: :ruby
16+
17+
# Use jquery as the JavaScript library
18+
gem 'jquery-rails'
19+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20+
gem 'turbolinks'
21+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22+
gem 'jbuilder', '~> 2.0'
23+
# bundle exec rake doc:rails generates the API under doc/api.
24+
gem 'sdoc', '~> 0.4.0', group: :doc
25+
26+
# Use ActiveModel has_secure_password
27+
# gem 'bcrypt', '~> 3.1.7'
28+
29+
# Use Unicorn as the app server
30+
# gem 'unicorn'
31+
32+
# Use Capistrano for deployment
33+
# gem 'capistrano-rails', group: :development
34+
35+
group :development, :test do
36+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
37+
gem 'byebug'
38+
39+
# Access an IRB console on exception pages or by using <%= console %> in views
40+
gem 'web-console', '~> 2.0'
41+
42+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
43+
gem 'spring'
44+
end
45+

Gemfile.lock

+213
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
GIT
2+
remote: git://github.com/activeadmin/activeadmin.git
3+
revision: c4a21cdcdb2fa1274ce9226208ee1656dee8434a
4+
specs:
5+
activeadmin (1.0.0.pre1)
6+
arbre (~> 1.0, >= 1.0.2)
7+
bourbon
8+
coffee-rails
9+
formtastic (~> 3.1)
10+
formtastic_i18n
11+
inherited_resources (~> 1.6)
12+
jquery-rails
13+
jquery-ui-rails (~> 5.0)
14+
kaminari (~> 0.15)
15+
rails (>= 3.2, < 5.0)
16+
ransack (~> 1.3)
17+
sass-rails
18+
19+
GEM
20+
remote: https://rubygems.org/
21+
specs:
22+
actionmailer (4.2.0)
23+
actionpack (= 4.2.0)
24+
actionview (= 4.2.0)
25+
activejob (= 4.2.0)
26+
mail (~> 2.5, >= 2.5.4)
27+
rails-dom-testing (~> 1.0, >= 1.0.5)
28+
actionpack (4.2.0)
29+
actionview (= 4.2.0)
30+
activesupport (= 4.2.0)
31+
rack (~> 1.6.0)
32+
rack-test (~> 0.6.2)
33+
rails-dom-testing (~> 1.0, >= 1.0.5)
34+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
35+
actionview (4.2.0)
36+
activesupport (= 4.2.0)
37+
builder (~> 3.1)
38+
erubis (~> 2.7.0)
39+
rails-dom-testing (~> 1.0, >= 1.0.5)
40+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
41+
activejob (4.2.0)
42+
activesupport (= 4.2.0)
43+
globalid (>= 0.3.0)
44+
activemodel (4.2.0)
45+
activesupport (= 4.2.0)
46+
builder (~> 3.1)
47+
activerecord (4.2.0)
48+
activemodel (= 4.2.0)
49+
activesupport (= 4.2.0)
50+
arel (~> 6.0)
51+
activesupport (4.2.0)
52+
i18n (~> 0.7)
53+
json (~> 1.7, >= 1.7.7)
54+
minitest (~> 5.1)
55+
thread_safe (~> 0.3, >= 0.3.4)
56+
tzinfo (~> 1.1)
57+
arbre (1.0.3)
58+
activesupport (>= 3.0.0)
59+
arel (6.0.0)
60+
binding_of_caller (0.7.2)
61+
debug_inspector (>= 0.0.1)
62+
bourbon (4.2.1)
63+
sass (~> 3.4)
64+
thor
65+
builder (3.2.2)
66+
byebug (3.5.1)
67+
columnize (~> 0.8)
68+
debugger-linecache (~> 1.2)
69+
slop (~> 3.6)
70+
coffee-rails (4.1.0)
71+
coffee-script (>= 2.2.0)
72+
railties (>= 4.0.0, < 5.0)
73+
coffee-script (2.3.0)
74+
coffee-script-source
75+
execjs
76+
coffee-script-source (1.9.1)
77+
columnize (0.9.0)
78+
debug_inspector (0.0.2)
79+
debugger-linecache (1.2.0)
80+
erubis (2.7.0)
81+
execjs (2.4.0)
82+
formtastic (3.1.3)
83+
actionpack (>= 3.2.13)
84+
formtastic_i18n (0.1.1)
85+
globalid (0.3.3)
86+
activesupport (>= 4.1.0)
87+
has_scope (0.6.0)
88+
actionpack (>= 3.2, < 5)
89+
activesupport (>= 3.2, < 5)
90+
hike (1.2.3)
91+
i18n (0.7.0)
92+
inherited_resources (1.6.0)
93+
actionpack (>= 3.2, < 5)
94+
has_scope (~> 0.6.0.rc)
95+
railties (>= 3.2, < 5)
96+
responders
97+
jbuilder (2.2.11)
98+
activesupport (>= 3.0.0, < 5)
99+
multi_json (~> 1.2)
100+
jquery-rails (4.0.3)
101+
rails-dom-testing (~> 1.0)
102+
railties (>= 4.2.0)
103+
thor (>= 0.14, < 2.0)
104+
jquery-ui-rails (5.0.3)
105+
railties (>= 3.2.16)
106+
json (1.8.2)
107+
kaminari (0.16.3)
108+
actionpack (>= 3.0.0)
109+
activesupport (>= 3.0.0)
110+
loofah (2.0.1)
111+
nokogiri (>= 1.5.9)
112+
mail (2.6.3)
113+
mime-types (>= 1.16, < 3)
114+
mime-types (2.4.3)
115+
mini_portile (0.6.2)
116+
minitest (5.5.1)
117+
multi_json (1.11.0)
118+
nokogiri (1.6.6.2)
119+
mini_portile (~> 0.6.0)
120+
polyamorous (1.1.0)
121+
activerecord (>= 3.0)
122+
rack (1.6.0)
123+
rack-test (0.6.3)
124+
rack (>= 1.0)
125+
rails (4.2.0)
126+
actionmailer (= 4.2.0)
127+
actionpack (= 4.2.0)
128+
actionview (= 4.2.0)
129+
activejob (= 4.2.0)
130+
activemodel (= 4.2.0)
131+
activerecord (= 4.2.0)
132+
activesupport (= 4.2.0)
133+
bundler (>= 1.3.0, < 2.0)
134+
railties (= 4.2.0)
135+
sprockets-rails
136+
rails-deprecated_sanitizer (1.0.3)
137+
activesupport (>= 4.2.0.alpha)
138+
rails-dom-testing (1.0.5)
139+
activesupport (>= 4.2.0.beta, < 5.0)
140+
nokogiri (~> 1.6.0)
141+
rails-deprecated_sanitizer (>= 1.0.1)
142+
rails-html-sanitizer (1.0.2)
143+
loofah (~> 2.0)
144+
railties (4.2.0)
145+
actionpack (= 4.2.0)
146+
activesupport (= 4.2.0)
147+
rake (>= 0.8.7)
148+
thor (>= 0.18.1, < 2.0)
149+
rake (10.4.2)
150+
ransack (1.6.3)
151+
actionpack (>= 3.0)
152+
activerecord (>= 3.0)
153+
activesupport (>= 3.0)
154+
i18n
155+
polyamorous (~> 1.1)
156+
rdoc (4.2.0)
157+
responders (2.1.0)
158+
railties (>= 4.2.0, < 5)
159+
sass (3.4.13)
160+
sass-rails (5.0.1)
161+
railties (>= 4.0.0, < 5.0)
162+
sass (~> 3.1)
163+
sprockets (>= 2.8, < 4.0)
164+
sprockets-rails (>= 2.0, < 4.0)
165+
tilt (~> 1.1)
166+
sdoc (0.4.1)
167+
json (~> 1.7, >= 1.7.7)
168+
rdoc (~> 4.0)
169+
slop (3.6.0)
170+
spring (1.3.3)
171+
sprockets (2.12.3)
172+
hike (~> 1.2)
173+
multi_json (~> 1.0)
174+
rack (~> 1.0)
175+
tilt (~> 1.1, != 1.3.0)
176+
sprockets-rails (2.2.4)
177+
actionpack (>= 3.0)
178+
activesupport (>= 3.0)
179+
sprockets (>= 2.8, < 4.0)
180+
sqlite3 (1.3.10)
181+
thor (0.19.1)
182+
thread_safe (0.3.5)
183+
tilt (1.4.1)
184+
turbolinks (2.5.3)
185+
coffee-rails
186+
tzinfo (1.2.2)
187+
thread_safe (~> 0.1)
188+
uglifier (2.7.1)
189+
execjs (>= 0.3.0)
190+
json (>= 1.8.0)
191+
web-console (2.1.2)
192+
activemodel (>= 4.0)
193+
binding_of_caller (>= 0.7.2)
194+
railties (>= 4.0)
195+
sprockets-rails (>= 2.0, < 4.0)
196+
197+
PLATFORMS
198+
ruby
199+
200+
DEPENDENCIES
201+
activeadmin!
202+
byebug
203+
coffee-rails (~> 4.1.0)
204+
jbuilder (~> 2.0)
205+
jquery-rails
206+
rails (= 4.2.0)
207+
sass-rails (~> 5.0)
208+
sdoc (~> 0.4.0)
209+
spring
210+
sqlite3
211+
turbolinks
212+
uglifier (>= 1.3.0)
213+
web-console (~> 2.0)

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ActiveAdmin Helper Reload Bug
2+
3+
This app is to reproduce [activeadmin/activeadmin#697](https://github.com/activeadmin/activeadmin/issues/697#issuecomment-78875499).
4+
5+
## Setup
6+
7+
1. `git clone [email protected]:activeadmin/activeadmin_helper_reload_bug.git`
8+
2. `bundle install`
9+
3. `rake db:migrate`
10+
4. `rails server`
11+
12+
## Reproduce 1
13+
14+
1. go to [http://localhost:3000/admin](http://localhost:3000/admin) or what ever your host / port is
15+
2. you should see `23` as value
16+
4. edit `app/helpers/application_helper.rb` and change `23` to `42`
17+
5. reload the dashboard in the browser and you still see `23` and not the expected `42`
18+
19+
## Reproduce 2
20+
21+
1. go to [http://localhost:3000/admin](http://localhost:3000/admin) or what ever your host / port is
22+
2. you should see `23` as value
23+
4. edit `app/admin/dashboard.rb` and rename `a_static_value` to `a_other_static_value`
24+
4. edit `app/helpers/application_helper.rb` and rename `a_static_value` to `a_other_static_value`
25+
5. reload the dashboard in the browser and you get this error:
26+
```
27+
undefined local variable or method `a_other_static_value' for #<ActiveAdmin::Views::Pages::Page:0x007fab52f82ac8>
28+
```

Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require File.expand_path('../config/application', __FILE__)
5+
6+
Rails.application.load_tasks

app/admin/dashboard.rb

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
ActiveAdmin.register_page "Dashboard" do
2+
3+
menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") }
4+
5+
content title: proc{ I18n.t("active_admin.dashboard") } do
6+
div class: "blank_slate_container", id: "dashboard_default_message" do
7+
span class: "blank_slate" do
8+
span "return value of ApplicationHelper#a_static_value"
9+
small a_static_value
10+
end
11+
end
12+
13+
# Here is an example of a simple dashboard with columns and panels.
14+
#
15+
# columns do
16+
# column do
17+
# panel "Recent Posts" do
18+
# ul do
19+
# Post.recent(5).map do |post|
20+
# li link_to(post.title, admin_post_path(post))
21+
# end
22+
# end
23+
# end
24+
# end
25+
26+
# column do
27+
# panel "Info" do
28+
# para "Welcome to ActiveAdmin."
29+
# end
30+
# end
31+
# end
32+
end # content
33+
end

app/assets/images/.keep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#= require active_admin/base

app/assets/javascripts/application.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file.
9+
//
10+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require jquery
14+
//= require jquery_ujs
15+
//= require turbolinks
16+
//= require_tree .
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SASS variable overrides must be declared before loading up Active Admin's styles.
2+
//
3+
// To view the variables that Active Admin provides, take a look at
4+
// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
5+
// Active Admin source.
6+
//
7+
// For example, to change the sidebar width:
8+
// $sidebar-width: 242px;
9+
10+
// Active Admin's got SASS!
11+
@import "active_admin/mixins";
12+
@import "active_admin/base";
13+
14+
// Overriding any non-variable SASS must be done after the fact.
15+
// For example, to change the default status-tag color:
16+
//
17+
// .status_tag { background: #6090DB; }

0 commit comments

Comments
 (0)