activeadmin


Active Admin Scope with rails 4.1


I am getting this error in Active Admin with rails 4.1
Showing ../bundler/gems/active_admin-ad33a0f6c772/app/views/active_admin/resource/index.html.arb where line #1 raised:
undefined method `call' for ClassList::ActiveRecord_Relation:0xa9f44bc
Extracted source (around line #1)
1 insert_tag renderer_for(:index)
Below is my code that I am using
ActiveAdmin.register ClassList do
#....
scope :upcoming_classes
#....
end
and in Model
class ClassList < ActiveRecord::Base
scope :upcoming_classes, where('class_date > ?', Date.today)
end
Please anyone help me in fixing this error?
Thanks,
You should define your scope using a proc.
class ClassList < ActiveRecord::Base
scope :upcoming_classes, proc { where('class_date > ?', Date.today) }
end
Rails 4+ expects scopes to be wrapped with a callable object, which is usually defined as a proc. See the Active Record Query Interface: Scopes documentation; there they use the -> { } proc syntax.

Related Links

How do I add a custom form for my collection_action/controller?
Active Admin Scope with rails 4.1
Setting initial values for new resource in Active Admin
multiselect check_boxes with activeadmin rails 4.0.3
make column of associated resource in index table non-linked
ActiveAdmin - all types update action show no member in struct
rolify+activeAdmin add role by form
Can ActiveAdmin connect to an API?
uninitialized constant [Active Admin]
how to remove a belongs_to field link in index
NoMethodError in ActiveAdmin::Devise::Sessions#new
Creating a new admin user in activeadmin
ActiveAdmin limiting has_many association retrieval?
In Active Admin, all of my models form views seem to refer just one of those models
Rails ActiveAdmin : How to place filters on the top in index action
change css styles of active admin

Categories

HOME
xpath
orientdb
extjs
protocol-buffers
blast
dry
android-emulator
informatica
websocket
qooxdoo
stored-procedures
native-base
lda
xamarin-zebble
circleci
chromecast
buffer
spring-amqp
responsivevoice
stimulsoft
mahout-recommender
bnf
vmware-workstation
c#-7.0
vertica
exe
unity-container
backendless
web-config-transform
miniprofiler
django-import-export
sfml
quick-nimble
john-the-ripper
plantuml
advanced-filter
cmis
cups
cargo
selenide
word-cloud
apache-toree
destroy
flume-twitter
hibernate-ogm
phppgadmin
maven-jaxb2-plugin
line-intersection
popen
ptvs
sidewaffle
bpms
allegro
rational-performance-test
msg
s-function
openquery
pyaudio
android-sdcard
apple-configurator
timestamping
xcopy
mnesia
gravatar
preferenceactivity
currency-exchange-rates
voronoi
pack
cortana
stack-smash
variable-length-array
fanotify
blank-line
360-degrees
green-threads
modern.ie
ampersand
phonegap-facebook-plugin
jolie
uno
symja
xulrunner
typesafe-stack
sunstudio
jquery-lazyload
2d-vector
websphere-6.1
system-information
trialware
prototypal-inheritance
acpi
n-queens
fbml
differentiation
vows
qt-mobility
jmenu
ognl
mongrel2
sscli
zend-test
3270
main-method
subtext
ning
version-control-migration

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App