Activeadmin and Paperclip : ArgumentError - ruby-on-rails

I use Activeadmin, paperclip and Rails 4.
When i want to create a new article with multi images, I have this Error :
ArgumentError in Admin::Articles#new
wrong number of arguments (1 for 0)
When I try with just one image I have the same error.
ActiveAdmin : article.rb
ActiveAdmin.register Article do
controller do
def permitted_params
params.permit article: [:title, :images_attributes => [:picture, :id, :_destroy]]
end
end
form do |f|
f.inputs "Project Details" do
f.input :title
f.has_many :images do |p|
p.inputs do
p.input :_destroy, :as => :boolean, :label => "Destroy?" unless p.object.new_record?
p.input :picture, :as => :file, :hint => p.object.new_record? ? "" : f.template.image_tag(p.object.picture.url(:thumb))
end
end
end
f.actions
end
end
Models : article.rb
class Article < ActiveRecord::Base
has_many :images, :dependent => :destroy
accepts_nested_attributes_for :images, :allow_destroy => true
end
Models : image.rb
class Image < ActiveRecord::Base
belongs_to :article
has_attached_file :picture, :styles => { :large => "960x640>", :medium => "300x300>", :thumb => "150x150>" }, :default_url => "/images/:style/missing.png"
end
Migration :
class CreateImages < ActiveRecord::Migration
def change
create_table :images do |t|
t.belongs_to :article
t.attachment :picture
t.timestamps
end
end
end
Full trace of my error :
paperclip (4.1.1) lib/paperclip/has_attached_file.rb:83:in `block in add_required_validations'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/validations.rb:39:in `call'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/validations.rb:39:in `validator_relevant?'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/validations.rb:27:in `block in validations'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/validations.rb:26:in `select'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/validations.rb:26:in `validations'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/validations.rb:129:in `validations?'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/validations.rb:136:in `required?'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/labelling.rb:25:in `requirement_text_or_proc'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/labelling.rb:29:in `requirement_text'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/labelling.rb:20:in `label_text'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/labelling.rb:9:in `label_html'
formtastic (2.3.0.rc2) lib/formtastic/inputs/file_input.rb:36:in `block in to_html'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
formtastic (2.3.0.rc2) lib/formtastic/inputs/base/wrapping.rb:11:in `input_wrapping'
formtastic (2.3.0.rc2) lib/formtastic/inputs/file_input.rb:35:in `to_html'
formtastic (2.3.0.rc2) lib/formtastic/helpers/input_helper.rb:241:in `input'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:26:in `block in input'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:26:in `input'
app/admin/article.rb:16:in `block (5 levels) in <top (required)>'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:143:in `block in field_set_and_list_wrapping'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
formtastic (2.3.0.rc2) lib/formtastic/helpers/fieldset_wrapper.rb:32:in `field_set_and_list_wrapping'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:142:in `field_set_and_list_wrapping'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:292:in `inputs'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:20:in `block in inputs'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:20:in `inputs'
app/admin/article.rb:14:in `block (4 levels) in <top (required)>'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:61:in `call'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:61:in `block in has_many'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:375:in `call'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:375:in `block (2 levels) in inputs_for_nested_attributes'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:143:in `block in field_set_and_list_wrapping'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
formtastic (2.3.0.rc2) lib/formtastic/helpers/fieldset_wrapper.rb:32:in `field_set_and_list_wrapping'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:142:in `field_set_and_list_wrapping'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:292:in `inputs'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:20:in `block in inputs'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:20:in `inputs'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:373:in `block in inputs_for_nested_attributes'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1864:in `block in fields_for_nested_model'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:699:in `fields_for'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1863:in `fields_for_nested_model'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1849:in `block in fields_for_with_nested_attributes'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1847:in `each'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1847:in `fields_for_with_nested_attributes'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1521:in `fields_for'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:391:in `inputs_for_nested_attributes'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:176:in `block in js_for_has_many'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:176:in `js_for_has_many'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:99:in `block in has_many'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:160:in `block in without_wrapper'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:160:in `without_wrapper'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:90:in `has_many'
app/admin/article.rb:13:in `block (3 levels) in <top (required)>'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:143:in `block in field_set_and_list_wrapping'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
formtastic (2.3.0.rc2) lib/formtastic/helpers/fieldset_wrapper.rb:32:in `field_set_and_list_wrapping'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:142:in `field_set_and_list_wrapping'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:292:in `inputs'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:20:in `block in inputs'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/form_builder.rb:20:in `inputs'
app/admin/article.rb:10:in `block (2 levels) in <top (required)>'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/form.rb:23:in `instance_exec'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/form.rb:23:in `block in main_content'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:435:in `form_for'
formtastic (2.3.0.rc2) lib/formtastic/helpers/form_helper.rb:167:in `block in semantic_form_for'
formtastic (2.3.0.rc2) lib/formtastic/helpers/form_helper.rb:190:in `with_custom_field_error_proc'
formtastic (2.3.0.rc2) lib/formtastic/helpers/form_helper.rb:166:in `semantic_form_for'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/view_helpers/form_helper.rb:9:in `active_admin_form_for'
arbre (1.0.1) lib/arbre/element.rb:175:in `method_missing'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/form.rb:22:in `main_content'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:83:in `block (2 levels) in build_main_content_wrapper'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:82:in `block in build_main_content_wrapper'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:81:in `build_main_content_wrapper'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:65:in `block in build_page_content'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:64:in `build_page_content'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:47:in `block (2 levels) in build_page'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:44:in `block in build_page'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:43:in `build_page'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/lib/active_admin/views/pages/base.rb:10:in `build'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/app/views/active_admin/resource/new.html.arb:1:in `block in __home_bibou__rvm_gems_ruby_______p____bundler_gems_active_admin___de_f__ae_d_app_views_active_admin_resource_new_html_arb__2699006568721876069_69819426589980'
arbre (1.0.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.0.1) lib/arbre/context.rb:45:in `initialize'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/app/views/active_admin/resource/new.html.arb:1:in `new'
/home/bibou/.rvm/gems/ruby-2.0.0-p353/bundler/gems/active_admin-66de2f86ae1d/app/views/active_admin/resource/new.html.arb:1:in `__home_bibou__rvm_gems_ruby_______p____bundler_gems_active_admin___de_f__ae_d_app_views_active_admin_resource_new_html_arb__2699006568721876069_69819426589980'
actionpack (4.0.2) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.2) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.2) lib/action_view/template.rb:141:in `render'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:127:in `_render_template'
actionpack (4.0.2) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:120:in `render_to_body'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
actionpack (4.0.2) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:97:in `render'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/bibou/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:233:in `default_render'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:161:in `to_html'
responders (1.0.0) lib/responders/flash_responder.rb:104:in `to_html'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:154:in `respond'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:147:in `call'
actionpack (4.0.2) lib/action_controller/metal/mime_responds.rb:330:in `respond_with'
inherited_resources (1.4.1) lib/inherited_resources/actions.rb:19:in `new'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.2) lib/active_support/callbacks.rb:433:in `_run__2406119207582674973__process_action__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.2) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.2) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__1775309793310121907__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/home/bibou/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/home/bibou/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/home/bibou/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Thank you for your help
Edit :
I use this gem for my project :
gem 'devise'
gem 'cancan'
gem 'activeadmin', github: 'gregbell/active_admin'
gem 'annotate'
gem 'ckeditor'
gem "paperclip", "~> 4.1"
My OS is a Ubuntu and I use ImageMagick-6.8.8-7.
When I run which convert
I have : /usr/local/bin/convert
development.rb
PaperclipActiveadmin::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# configure paperclip
Paperclip.options[:command_path] = "/usr/local/bin/"
end
Solution :
add require: false to my input :
p.input :picture, :as => :file, :hint => p.object.new_record? ? "" : f.template.image_tag(p.object.picture.url(:thumb)), required: false
And in my image.rb add a validates_attachment_content_type :
validates_attachment_content_type :picture, :content_type => ["image/jpg", "image/jpeg", "image/png"]
Thank You Philip Hallstrom for your help and your solution

Per https://github.com/justinfrench/formtastic/issues/999 the temporary solution is to add require: false to your input. Like so:
f.input :image, required: false
Just tried it and it works for me.

Related

How to fix ArgumentError in Admin::Payments#show : wrong number of arguments (1 for 0)

I try to add a "show" Interface for payments on Active Admin, so I added this code to my file "app/admin/payments.rb" :
ActiveAdmin.register Payment do
actions :index, :show
index do
column "Actions" do |payment|
links = []
links << link_to("View", admin_payment_path(payment))
links.join(" <br><br> ").html_safe
end
end
show do
attributes_table do
row :id
row :remote_id
row :credit_card_id
row :State
row :Refund_id
row :Created_at
row :updated_at
row :amount
row :currency
row :subscription_id
end
active_admin_comments
end
end
And I call this show action like that :
link_to("View", admin_payment_path(payment))
I have the following error thaht I can not understand :
ActionView::Template::Error (wrong number of arguments (1 for 0)):
1: insert_tag renderer_for(:show)
activerecord (4.0.3) lib/active_record/attribute_methods/read.rb:58:in `__temp__d6564786f646'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/view_helpers/display_helper.rb:30:in `display_name_method_for'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/view_helpers/display_helper.rb:18:in `display_name'
arbre (1.0.1) lib/arbre/element.rb:175:in `method_missing'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/show.rb:36:in `default_title'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/show.rb:14:in `title'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:25:in `block in build_active_admin_head'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:24:in `build_active_admin_head'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:9:in `build'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
/ruby/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/show.html.arb:1:in `block in __ruby_bundler_gems_active_admin__ca___f__ab__app_views_active_admin_resource_show_html_arb__2881818806947822812_77228080'
arbre (1.0.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.0.1) lib/arbre/context.rb:45:in `initialize'
/ruby/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/show.html.arb:1:in `new'
/ruby/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/show.html.arb:1:in `__ruby_bundler_gems_active_admin__ca___f__ab__app_views_active_admin_resource_show_html_arb__2881818806947822812_77228080'
actionpack (4.0.3) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.3) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.3) lib/action_view/template.rb:141:in `render'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
actionpack (4.0.3) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.3) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.3) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.3) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.3) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.3) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.3) lib/abstract_controller/rendering.rb:127:in `_render_template'
actionpack (4.0.3) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionpack (4.0.3) lib/abstract_controller/rendering.rb:120:in `render_to_body'
actionpack (4.0.3) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
actionpack (4.0.3) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
actionpack (4.0.3) lib/abstract_controller/rendering.rb:97:in `render'
actionpack (4.0.3) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.0.3) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/usr/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
activesupport (4.0.3) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.0.3) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.0.3) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.0.3) lib/action_controller/metal/responder.rb:233:in `default_render'
actionpack (4.0.3) lib/action_controller/metal/responder.rb:161:in `to_html'
responders (1.0.0) lib/responders/flash_responder.rb:104:in `to_html'
actionpack (4.0.3) lib/action_controller/metal/responder.rb:154:in `respond'
actionpack (4.0.3) lib/action_controller/metal/responder.rb:147:in `call'
actionpack (4.0.3) lib/action_controller/metal/mime_responds.rb:330:in `respond_with'
inherited_resources (1.4.1) lib/inherited_resources/actions.rb:13:in `show'
actionpack (4.0.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.0.3) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.3) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.3) lib/active_support/callbacks.rb:463:in `_run__1186283259363649751__process_action__callbacks'
activesupport (4.0.3) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.3) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.3) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.3) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.3) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.3) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.3) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.3) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.3) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:680:in `call'
omniauth (1.4.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.4.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.4.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.4.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.4.2) lib/omniauth/builder.rb:63:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.5) lib/rack/etag.rb:23:in `call'
rack (1.5.5) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.5) lib/rack/head.rb:11:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.3) lib/active_record/query_cache.rb:36:in `call'
airbrake (9.0.2) lib/airbrake/rack/middleware.rb:33:in `call!'
airbrake (9.0.2) lib/airbrake/rack/middleware.rb:21:in `call'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.3) lib/active_support/callbacks.rb:373:in `_run__4337536015866295967__call__callbacks'
activesupport (4.0.3) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.5) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.5) lib/rack/lock.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
rack-cors (0.4.1) lib/rack/cors.rb:81:in `call'
railties (4.0.3) lib/rails/engine.rb:511:in `call'
railties (4.0.3) lib/rails/application.rb:97:in `call'
rack (1.5.5) lib/rack/content_length.rb:14:in `call'
thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
thin (1.5.1) lib/thin/connection.rb:79:in `catch'
thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
thin (1.5.1) lib/thin/connection.rb:54:in `process'
thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
thin (1.5.1) lib/thin/server.rb:159:in `start'
rack (1.5.5) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.5) lib/rack/server.rb:264:in `start'
railties (4.0.3) lib/rails/commands/server.rb:84:in `start'
railties (4.0.3) lib/rails/commands.rb:76:in `block in <top (required)>'
railties (4.0.3) lib/rails/commands.rb:71:in `tap'
railties (4.0.3) lib/rails/commands.rb:71:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
Rendered /ruby/gems/actionpack-4.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms)
Rendered /ruby/gems/actionpack-4.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.4ms)
Rendered /ruby/gems/actionpack-4.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (10.3ms)
Thank you for your help, I am a beginner in Ruby On Rails and ActiveAdmin
It looks like the block opened by attributes_table do isn't closed, so I'd start by adding an end after the last row line and seeing if the error changes or disappears.
Also, for what it's worth, based on ActiveAdmin's API documentation, I don't think the line actions :index, :show is necessary -- it specifically says that "all CRUD actions are enabled by default", so there shouldn't be a need to explicitly define those actions. I might try taking it out and seeing what happens.
The exception indicates ActiveAdmin is not finding a default title for the page, so try:
show title: 'Payment' do
...
end
or define a display_name() method on the Payment model.

Rails 5.2.1 Active Admin ActionView::Template::Error when upgraded rails from version 4.2.6

I have updated rails version from 4.2.6 to rails 5.2.1.
When tried to access admin/login url is is giving error as
ActionView::Template::Error (wrong number of arguments (given 3, expected 0..1)):
1: insert_tag active_admin_application.view_factory["page"]
I have not overridden any part of activeadmin views in application.
Not used pagination related gem also.
I am using below versions
ruby 2.3.4
gem 'rails', '5.2.1'
gem 'activeadmin', '~> 1.3.0'
gem 'rails_friendly_urls', '~> 1.0.0'
Full trace of the error log is
ActionView::Template::Error (wrong number of arguments (given 3, expected 0..1)):
1: insert_tag active_admin_application.view_factory["page"]
rails_friendly_urls (1.0.1) lib/rails_friendly_urls/route_sets/rails3.rb:5:in `url_for'
actionpack (5.2.1) lib/action_dispatch/routing/route_set.rb:273:in `call'
actionpack (5.2.1) lib/action_dispatch/routing/route_set.rb:214:in `call'
actionpack (5.2.1) lib/action_dispatch/routing/route_set.rb:331:in `block (2 levels) in define_url_helper'
activeadmin (1.3.1) lib/active_admin/resource/routes.rb:54:in `public_send'
activeadmin (1.3.1) lib/active_admin/resource/routes.rb:54:in `collection_path'
activeadmin (1.3.1) lib/active_admin/resource/routes.rb:8:in `route_collection_path'
activeadmin (1.3.1) lib/active_admin/resource/menu.rb:30:in `block in default_menu_options'
activeadmin (1.3.1) lib/active_admin/view_helpers/method_or_proc_helper.rb:90:in `instance_exec'
activeadmin (1.3.1) lib/active_admin/view_helpers/method_or_proc_helper.rb:90:in `render_in_context'
activeadmin (1.3.1) lib/active_admin/menu_item.rb:71:in `url'
activeadmin (1.3.1) lib/active_admin/menu_item.rb:92:in `real_url?'
activeadmin (1.3.1) lib/active_admin/menu_item.rb:78:in `display?'
activeadmin (1.3.1) lib/active_admin/menu.rb:74:in `block in items'
activeadmin (1.3.1) lib/active_admin/menu.rb:74:in `select'
activeadmin (1.3.1) lib/active_admin/menu.rb:74:in `items'
activeadmin (1.3.1) lib/active_admin/views/tabbed_navigation.rb:27:in `menu_items'
activeadmin (1.3.1) lib/active_admin/views/tabbed_navigation.rb:37:in `build_menu'
activeadmin (1.3.1) lib/active_admin/views/tabbed_navigation.rb:22:in `build'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
activeadmin (1.3.1) lib/active_admin/views/header.rb:22:in `build_global_navigation'
activeadmin (1.3.1) lib/active_admin/views/header.rb:13:in `build'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
activeadmin (1.3.1) lib/active_admin/views/pages/base.rb:67:in `build_header'
activeadmin (1.3.1) lib/active_admin/views/pages/base.rb:52:in `block (2 levels) in build_page'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `div'
activeadmin (1.3.1) lib/active_admin/views/pages/base.rb:50:in `block in build_page'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
activeadmin (1.3.1) lib/active_admin/views/pages/base.rb:49:in `build_page'
activeadmin (1.3.1) lib/active_admin/views/pages/base.rb:10:in `build'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
activeadmin (1.3.1) app/views/active_admin/page/index.html.arb:2:in `block in __usr_local_rvm_gems_ruby_______gems_activeadmin_______app_views_active_admin_page_index_html_arb__684239489_129398360'
arbre (1.1.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.1.1) lib/arbre/context.rb:45:in `initialize'
activeadmin (1.3.1) app/views/active_admin/page/index.html.arb:1:in `new'
activeadmin (1.3.1) app/views/active_admin/page/index.html.arb:1:in `__usr_local_rvm_gems_ruby_______gems_activeadmin_______app_views_active_admin_page_index_html_arb__684239489_129398360'
actionview (5.2.1) lib/action_view/template.rb:159:in `block in render'
activesupport (5.2.1) lib/active_support/notifications.rb:170:in `instrument'
actionview (5.2.1) lib/action_view/template.rb:354:in `instrument_render_template'
actionview (5.2.1) lib/action_view/template.rb:157:in `render'
actionview (5.2.1) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
actionview (5.2.1) lib/action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
activesupport (5.2.1) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.1) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.1) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.2.1) lib/action_view/renderer/abstract_renderer.rb:43:in `instrument'
actionview (5.2.1) lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
actionview (5.2.1) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
actionview (5.2.1) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (5.2.1) lib/action_view/renderer/template_renderer.rb:16:in `render'
actionview (5.2.1) lib/action_view/renderer/renderer.rb:44:in `render_template'
actionview (5.2.1) lib/action_view/renderer/renderer.rb:25:in `render'
actionview (5.2.1) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.2.1) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionview (5.2.1) lib/action_view/rendering.rb:84:in `render_to_body'
actionpack (5.2.1) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.2.1) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (5.2.1) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (5.2.1) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.2.1) lib/action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'
activesupport (5.2.1) lib/active_support/core_ext/benchmark.rb:14:in `block in ms'
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
activesupport (5.2.1) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (5.2.1) lib/action_controller/metal/instrumentation.rb:46:in `block in render'
actionpack (5.2.1) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.2.1) lib/active_record/railties/controller_runtime.rb:31:in `cleanup_view_runtime'
actionpack (5.2.1) lib/action_controller/metal/instrumentation.rb:45:in `render'
meta-tags (2.10.0) lib/meta_tags/controller_helper.rb:20:in `render'
activeadmin (1.3.1) lib/active_admin/page_controller.rb:14:in `index'
actionpack (5.2.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (5.2.1) lib/abstract_controller/base.rb:194:in `process_action'
actionpack (5.2.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.2.1) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (5.2.1) lib/active_support/callbacks.rb:109:in `block in run_callbacks'
audited (4.8.0) lib/audited/sweeper.rb:14:in `around'
activesupport (5.2.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
audited (4.8.0) lib/audited/sweeper.rb:14:in `around'
activesupport (5.2.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
activesupport (5.2.1) lib/active_support/callbacks.rb:136:in `run_callbacks'
actionpack (5.2.1) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (5.2.1) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (5.2.1) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (5.2.1) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.1) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.1) lib/active_support/notifications.rb:168:in `instrument'
actionpack (5.2.1) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (5.2.1) lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
activerecord (5.2.1) lib/active_record/railties/controller_runtime.rb:24:in `process_action'
actionpack (5.2.1) lib/abstract_controller/base.rb:134:in `process'
actionview (5.2.1) lib/action_view/rendering.rb:32:in `process'
actionpack (5.2.1) lib/action_controller/metal.rb:191:in `dispatch'
actionpack (5.2.1) lib/action_controller/metal.rb:252:in `dispatch'
actionpack (5.2.1) lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
actionpack (5.2.1) lib/action_dispatch/routing/route_set.rb:34:in `serve'
actionpack (5.2.1) lib/action_dispatch/journey/router.rb:52:in `block in serve'
actionpack (5.2.1) lib/action_dispatch/journey/router.rb:35:in `each'
actionpack (5.2.1) lib/action_dispatch/journey/router.rb:35:in `serve'
actionpack (5.2.1) lib/action_dispatch/routing/route_set.rb:840:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (2.0.5) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.0.5) lib/rack/etag.rb:25:in `call'
rack (2.0.5) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.5) lib/rack/head.rb:12:in `call'
actionpack (5.2.1) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.0.5) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.5) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/cookies.rb:670:in `call'
activerecord (5.2.1) lib/active_record/migration.rb:559:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (5.2.1) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (5.2.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.1) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.1) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.1) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.1) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.1) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.5) lib/rack/method_override.rb:22:in `call'
rack (2.0.5) lib/rack/runtime.rb:22:in `call'
activesupport (5.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.0.5) lib/rack/sendfile.rb:111:in `call'
railties (5.2.1) lib/rails/engine.rb:524:in `call'
rack (2.0.5) lib/rack/handler/webrick.rb:86:in `service'
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'
Can anybody tell me, where I am going wrong.
rails_friendly_urls has not been updated since 2015, I'm pretty sure it is obsolete and you will have to remove or replace it to upgrade to Rails 5, the issue is not with ActiveAdmin.
I got solution for this,
Error was due to rails_friendly_urls gems.
In rails_friendly_urls gem https://github.com/calonso/rails_friendly_urls/blob/master/lib/rails_friendly_urls.rb
case RailsFriendlyUrls.rails_version
when '4.2'
require 'rails_friendly_urls/urls/rails4_2'
when '4.0', '4.1'
require 'rails_friendly_urls/urls/rails4_0'
when '3.2'
require 'rails_friendly_urls/route_sets/rails3'
else
raise NotImplementedError.new "Rails Friendly URLs gem doesn't support Rails #{Rails.version}"
end
Above part is written & it is not updated since 2015.
So we can have gem locally and change above file as
case RailsFriendlyUrls.rails_version
when '4.2', '5.2'
require 'rails_friendly_urls/route_sets/rails4_2'
require 'rails_friendly_urls/urls/rails4_2'
else
raise NotImplementedError.new "Rails Friendly URLs gem doesn't support Rails #{Rails.version}"
end
This will support in rails 5.2.1

How can I get rid of this error in active admin rails app NoMethodError in Admin::Records#show?

I have installed active admin gem to my rails app. I integrated with my models well. After I login to admin panel and want to view my records it shows this error. This error comes in updating and submitting the button. But internally the file is updated and edited, there is no side effect of this.
I have integrated my records with will paginate.
I have added this file to my /config/initializers/kaminari.rb too but couldnot solved...
Kaminari.configure do |config|
config.page_method_name = :per_page_kaminari
end
The complete error is:
undefined method `total_count' for #<ActiveRecord::Relation []>
Did you mean? total_entries
Extracted source (around line #124):
122 arel.public_send(method, *args, &block)
123 else
124 super
125 end
126 end
127 end
Application Trace | Framework Trace | Full Trace
activerecord (5.0.2) lib/active_record/relation/delegation.rb:124:in `method_missing'
activerecord (5.0.2) lib/active_record/relation/delegation.rb:94:in `method_missing'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb:23:in `title'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb:16:in `build'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `active_admin_comments_for'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/orm/active_record/comments/show_page_helper.rb:18:in `active_admin_comments'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/orm/active_record/comments/show_page_helper.rb:12:in `default_main_content'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/show.rb:23:in `main_content'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:91:in `block (2 levels) in build_main_content_wrapper'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:90:in `block in build_main_content_wrapper'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:89:in `build_main_content_wrapper'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:75:in `block in build_page_content'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:74:in `build_page_content'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:52:in `block (2 levels) in build_page'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:48:in `block in build_page'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:47:in `build_page'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/lib/active_admin/views/pages/base.rb:10:in `build'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/app/views/active_admin/resource/show.html.arb:2:in `block in __home_madhav__rbenv_versions_______lib_ruby_gems_______bundler_gems_activeadmin_____ea_f_fd__app_views_active_admin_resource_show_html_arb___2047537122749437189_69832972317760'
arbre (1.1.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.1.1) lib/arbre/context.rb:45:in `initialize'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/app/views/active_admin/resource/show.html.arb:1:in `new'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/activeadmin-6038ea6f8fd0/app/views/active_admin/resource/show.html.arb:1:in `__home_madhav__rbenv_versions_______lib_ruby_gems_______bundler_gems_activeadmin_____ea_f_fd__app_views_active_admin_resource_show_html_arb___2047537122749437189_69832972317760'
actionview (5.0.2) lib/action_view/template.rb:159:in `block in render'
activesupport (5.0.2) lib/active_support/notifications.rb:166:in `instrument'
actionview (5.0.2) lib/action_view/template.rb:354:in `instrument'
actionview (5.0.2) lib/action_view/template.rb:157:in `render'
actionview (5.0.2) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
actionview (5.0.2) lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
activesupport (5.0.2) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.2) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.2) lib/active_support/notifications.rb:164:in `instrument'
actionview (5.0.2) lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
actionview (5.0.2) lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
actionview (5.0.2) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
actionview (5.0.2) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (5.0.2) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (5.0.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (5.0.2) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.0.2) lib/action_view/rendering.rb:104:in `_render_template'
actionpack (5.0.2) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (5.0.2) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (5.0.2) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.0.2) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (5.0.2) lib/abstract_controller/rendering.rb:26:in `render'
actionpack (5.0.2) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.0.2) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (5.0.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/madhav/.rbenv/versions/2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
activesupport (5.0.2) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (5.0.2) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (5.0.2) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.0.2) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (5.0.2) lib/action_controller/metal/instrumentation.rb:43:in `render'
responders (2.4.0) lib/action_controller/responder.rb:238:in `default_render'
responders (2.4.0) lib/action_controller/responder.rb:170:in `to_html'
responders (2.4.0) lib/responders/flash_responder.rb:107:in `to_html'
responders (2.4.0) lib/action_controller/responder.rb:163:in `respond'
responders (2.4.0) lib/action_controller/responder.rb:156:in `call'
responders (2.4.0) lib/action_controller/respond_with.rb:211:in `respond_with'
inherited_resources (1.7.2) lib/inherited_resources/actions.rb:13:in `show'
actionpack (5.0.2) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.0.2) lib/abstract_controller/base.rb:188:in `process_action'
actionpack (5.0.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.0.2) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.0.2) lib/active_support/callbacks.rb:126:in `call'
activesupport (5.0.2) lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
activesupport (5.0.2) lib/active_support/callbacks.rb:455:in `call'
activesupport (5.0.2) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.2) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
activesupport (5.0.2) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.0.2) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.0.2) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.0.2) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.2) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.2) lib/active_support/notifications.rb:164:in `instrument'
actionpack (5.0.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.0.2) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
activerecord (5.0.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (5.0.2) lib/abstract_controller/base.rb:126:in `process'
actionview (5.0.2) lib/action_view/rendering.rb:30:in `process'
actionpack (5.0.2) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (5.0.2) lib/action_controller/metal.rb:262:in `dispatch'
actionpack (5.0.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (5.0.2) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.0.2) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.2) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.2) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.2) lib/action_dispatch/routing/route_set.rb:725:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.1) lib/rack/head.rb:12:in `call'
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.2) lib/active_record/migration.rb:553:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.2) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.2) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.2) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.2) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.2) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.2) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.2) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.2) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.2) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.2) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.2) lib/rails/engine.rb:522:in `call'
puma (3.8.2) lib/puma/configuration.rb:224:in `call'
puma (3.8.2) lib/puma/server.rb:600:in `handle_request'
puma (3.8.2) lib/puma/server.rb:435:in `process_client'
puma (3.8.2) lib/puma/server.rb:299:in `block in run'
puma (3.8.2) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
Screenshot of error is:
I have disabled the active admin comments. Previously, comments were enabled by default in the file
/config/initializers/active_admin.rb
# You can completely disable comments:
# config.comments = false
I disabled the active admin comments by changing the code:
# You can completely disable comments:
config.comments = false
And finally get rid of that error.
Thank you all.

active admin, formtastic with nested attributes, undefined method `call' for nil:NilClass

I am trying to implement a form with a many to many association (with :through) using active_admin. I am receiving undefined method `call' for nil:NilClass error message.
I am new to ruby and rails.
My models:
article.rb
class Article < ActiveRecord::Base
has_many :tagged_articles
has_many :tags, :through => :tagged_articles, :source => :tag, :class_name => TaggedArticle
accepts_nested_attributes_for :tags
end
tagged_article.rb
class TaggedArticle < ActiveRecord::Base
belongs_to :article
belongs_to :tag
end
tag.rb
class Tag < ActiveRecord::Base
has_many :tagged_articles
has_many :articles, :through => :tagged_articles
end
view
_form.html
<%= semantic_form_for #article, :html => {:id => "new_article",
:novalidate => "novalidate"} do |f| %>
app/admin/article.rb (active_admin file)
ActiveAdmin.register Article do
form partial: 'form'
form do |f|
f.has_many :tags, heading: 'Tags', allow_destroy: true, new_record: true
f.actions
end
show do
# renders app/views/admin/posts/_some_partial.html.erb
render 'preview'
end
#permit_params :title, :text,
# tags_attributes: [:name]
permit_params do
permitted = [:title, :text,
tags_attributes: [:name]]
# permitted << :other if resource.something?
permitted
end
end
I get this error (when opening the form)
Application trace
Extracted source (around line #1):
1
insert_tag renderer_for(:new)
app/admin/article.rb:6:in `block (2 levels) in <top (required)>'
Full trace
Application Trace | Framework Trace | Full Trace
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:61:in `block in has_many'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:375:in `call'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:375:in `block (2 levels) in inputs_for_nested_attributes'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:143:in `block in field_set_and_list_wrapping'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
formtastic (2.3.0.rc2) lib/formtastic/helpers/fieldset_wrapper.rb:32:in `field_set_and_list_wrapping'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:142:in `field_set_and_list_wrapping'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:292:in `inputs'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:20:in `block in inputs'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:20:in `inputs'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:373:in `block in inputs_for_nested_attributes'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1864:in `block in fields_for_nested_model'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:699:in `fields_for'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1863:in `fields_for_nested_model'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1849:in `block in fields_for_with_nested_attributes'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1847:in `each'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1847:in `fields_for_with_nested_attributes'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:1521:in `fields_for'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:391:in `inputs_for_nested_attributes'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:176:in `block in js_for_has_many'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:176:in `js_for_has_many'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:99:in `block in has_many'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:160:in `block in without_wrapper'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:151:in `with_new_form_buffer'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:160:in `without_wrapper'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/form_builder.rb:90:in `has_many'
app/admin/article.rb:6:in `block (2 levels) in <top (required)>'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/form.rb:23:in `instance_exec'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/form.rb:23:in `block in main_content'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:435:in `form_for'
formtastic (2.3.0.rc2) lib/formtastic/helpers/form_helper.rb:167:in `block in semantic_form_for'
formtastic (2.3.0.rc2) lib/formtastic/helpers/form_helper.rb:190:in `with_custom_field_error_proc'
formtastic (2.3.0.rc2) lib/formtastic/helpers/form_helper.rb:166:in `semantic_form_for'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/view_helpers/form_helper.rb:9:in `active_admin_form_for'
arbre (1.0.1) lib/arbre/element.rb:175:in `method_missing'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/form.rb:22:in `main_content'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:83:in `block (2 levels) in build_main_content_wrapper'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:82:in `block in build_main_content_wrapper'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:81:in `build_main_content_wrapper'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:65:in `block in build_page_content'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:64:in `build_page_content'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:47:in `block (2 levels) in build_page'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:44:in `block in build_page'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:43:in `build_page'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:10:in `build'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/new.html.arb:1:in `block in __home_javkhlan__rvm_gems_ruby_______bundler_gems_active_admin__ca___f__ab__app_views_active_admin_resource_new_html_arb__4076692881198465766_51912660'
arbre (1.0.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.0.1) lib/arbre/context.rb:45:in `initialize'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/new.html.arb:1:in `new'
/home/javkhlan/.rvm/gems/ruby-2.1.0/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/new.html.arb:1:in `__home_javkhlan__rvm_gems_ruby_______bundler_gems_active_admin__ca___f__ab__app_views_active_admin_resource_new_html_arb__4076692881198465766_51912660'
actionpack (4.0.2) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.2) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.2) lib/action_view/template.rb:141:in `render'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:127:in `_render_template'
actionpack (4.0.2) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:120:in `render_to_body'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
actionpack (4.0.2) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:97:in `render'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/javkhlan/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:233:in `default_render'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:161:in `to_html'
responders (1.0.0) lib/responders/flash_responder.rb:104:in `to_html'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:154:in `respond'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:147:in `call'
actionpack (4.0.2) lib/action_controller/metal/mime_responds.rb:330:in `respond_with'
inherited_resources (1.4.1) lib/inherited_resources/actions.rb:19:in `new'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.2) lib/active_support/callbacks.rb:433:in `_run__1569366334490291269__process_action__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.2) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.2) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__782737588198479971__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/home/javkhlan/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
/home/javkhlan/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
/home/javkhlan/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
Any idea on how i can make it working?
I think that the reason for nilclass error was that there were no assigned fields for the nested form.
Adding
f.has_many :tags do |cf|
cf.input :tag, :label => "Tag"
end
solved the nilclass problem
In the end, the following code worked. And there was no need to wirte _form.html.erb in this particular case.
form do |f|
f.has_many :tags do |cf|
cf.input :tag, :label => "Tag"
end
f.actions
end
If you're using allow_destroy: true in the form fields, you also need to use it on accepts_nested_attributes_for.
class Article < ActiveRecord::Base
has_many :tagged_articles
has_many :tags, :through => :tagged_articles, :source => :tag, :class_name => TaggedArticle
accepts_nested_attributes_for :tags, allow_destroy: true
end

Using date_select under Ransack throws NoMethodError for 'day'

I'm trying to build a simple search form using the Ransack gem under rails. Though when using date_select, Ransack throws an NoMethodError for using 'day' on a '[2014,1,1]' String. Why is Ransack converting the Date Object to a String?
Here's my search form
<%= search_form_for #search, url: search_offer_path do |f| %>
<p>
<%= f.label :city_cont, "Choose City" %>
<%= f.text_field :city_cont %>
<%= f.label :available_dates_cont, "Choose Date" %>
<%= f.date_select :available_dates_cont %>
<%= f.label :available_times_cont, "Choose Time" %>
<%= f.time_select :available_times_cont %>
</p>
<p class="button"><%= f.submit "Search" %></p>
<% end %>
The fields :available_dates and :available_times contain hashes of multiple dates and times using the serializer
Thanks in advance
This is my error output:
actionpack (4.0.2) lib/action_view/helpers/date_helper.rb:821:in `block (2 levels) in <class:DateTimeSelector>'
actionpack (4.0.2) lib/action_view/helpers/date_helper.rb:774:in `select_day'
actionpack (4.0.2) lib/action_view/helpers/date_helper.rb:1025:in `block in build_selects_from_types'
actionpack (4.0.2) lib/action_view/helpers/date_helper.rb:1023:in `each'
actionpack (4.0.2) lib/action_view/helpers/date_helper.rb:1023:in `build_selects_from_types'
actionpack (4.0.2) lib/action_view/helpers/date_helper.rb:723:in `select_date'
actionpack (4.0.2) lib/action_view/helpers/tags/date_select.rb:14:in `render'
actionpack (4.0.2) lib/action_view/helpers/date_helper.rb:255:in `date_select'
actionpack (4.0.2) lib/action_view/helpers/date_helper.rb:1055:in `date_select'
app/views/offers/index_public.html.erb:7:in `block in _app_views_offers_index_public_html_erb__3128909028606137015_44602620'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:435:in `form_for'
ransack (1.1.0) lib/ransack/helpers/form_helper.rb:24:in `search_form_for'
app/views/offers/index_public.html.erb:1:in `_app_views_offers_index_public_html_erb__3128909028606137015_44602620'
actionpack (4.0.2) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.2) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.2) lib/action_view/template.rb:141:in `render'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:127:in `_render_template'
actionpack (4.0.2) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:120:in `render_to_body'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
actionpack (4.0.2) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:97:in `render'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/Basti/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:40:in `render'
app/controllers/offers_controller.rb:52:in `index_public'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.2) lib/active_support/callbacks.rb:423:in `_run__162092440143471620__process_action__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.2) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.1.4) lib/omniauth/builder.rb:49:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.2) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__174773027674768040__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
thin (1.6.1) lib/thin/connection.rb:82:in `block in pre_process'
thin (1.6.1) lib/thin/connection.rb:80:in `catch'
thin (1.6.1) lib/thin/connection.rb:80:in `pre_process'
thin (1.6.1) lib/thin/connection.rb:55:in `process'
thin (1.6.1) lib/thin/connection.rb:41:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.6.1) lib/thin/backends/base.rb:73:in `start'
thin (1.6.1) lib/thin/server.rb:162:in `start'
rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.2) lib/rack/server.rb:264:in `start'
railties (4.0.2) lib/rails/commands/server.rb:84:in `start'
railties (4.0.2) lib/rails/commands.rb:76:in `block in <top (required)>'
railties (4.0.2) lib/rails/commands.rb:71:in `tap'
railties (4.0.2) lib/rails/commands.rb:71:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

Resources