Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin-side Category Delete produces CategoriesController error #572

Open
vcavallo opened this issue Jun 25, 2014 · 14 comments
Open

Admin-side Category Delete produces CategoriesController error #572

vcavallo opened this issue Jun 25, 2014 · 14 comments
Milestone

Comments

@vcavallo
Copy link

Using:

  • Ruby 1.9.3
  • Rails 4.0.3
  • "rails4" branch of Forem

When navigating to /forums/admin/categories and clicking "delete" for a category, this error is raised:

AbstractController::ActionNotFound - The action 'show' could not be found for Forem::Admin::CategoriesController:

The same seems to happen for any delete actions on Forums (/forums/admin/forums) and Groups (/forums/admin/groups) as well.

If I stick a show.html.erb file in app/views/forem/admin/categories, the delete action doesn't complain and routes to that file. But the :delete method doesn't fire.

Any ideas? I'm happy to provide any further necessary information. See below for full stack trace, gemfile and gemfile.lock


full stack trace:

Started GET "/forums/admin/categories/testing-this-thinger" for 127.0.0.1 at 2014-06-25 16:31:02 -0400

AbstractController::ActionNotFound - The action 'show' could not be found for Forem::Admin::CategoriesController:
  actionpack (4.0.3) lib/abstract_controller/base.rb:131: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 `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 `call'
  actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:680:in `call'
  railties (4.0.3) lib/rails/engine.rb:511:in `call'
  railties (4.0.3) lib/rails/railtie/configurable.rb:30:in `method_missing'
  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 `call'
  actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:680:in `call'
  omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
  omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
  omniauth (1.2.1) lib/omniauth/builder.rb:59:in `call'
  rack-livereload (0.3.15) lib/rack/livereload.rb:23:in `_call'
  rack-livereload (0.3.15) lib/rack/livereload.rb:14:in `call'
  rails4_client_side_validations (0.0.3) lib/rails4_client_side_validations/middleware.rb:21: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.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.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.3) lib/action_dispatch/middleware/cookies.rb:486:in `call'
  activerecord (4.0.3) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
  activerecord (4.0.3) lib/active_record/migration.rb:369: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__468131918321514821__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'
  better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:56: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.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) 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.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112: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.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'
  /Users/vinney/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /Users/vinney/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /Users/vinney/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

Gemfile: https://gist.github.com/vcavallo/8681c1fac0adac0a82df
Gemfile.lock: https://gist.github.com/vcavallo/c5802edf54b563dff350

@radar
Copy link
Collaborator

radar commented Jul 2, 2014

@vcavallo First thought is that jquery_ujs isn't loaded, which is typically what makes those delete links work. Are you able to reproduce this issue in a new app with that Gemfile?

@evaogbe
Copy link

evaogbe commented Jul 10, 2014

@radar I had the same problem. Made a new app that shows the error.

@NelsonBrandao
Copy link

@radar In the config/initializers/forem.rb file add:

Rails.application.config.to_prepare do
Forem.layout = "application"
end

That should fix it

@evaogbe
Copy link

evaogbe commented Jul 23, 2014

Changing the links to buttons (link_to -> button_to) also works. More semantic too.

@ivgames
Copy link

ivgames commented Sep 29, 2014

Also has same proble, and also changed forum layout

@ivgames
Copy link

ivgames commented Sep 29, 2014

Approved below:
//-------------------------------------
@radar In the config/initializers/forem.rb file add:

Rails.application.config.to_prepare do
Forem.layout = "application"
end

That should fix it

@radar
Copy link
Collaborator

radar commented Sep 29, 2014

Can someone please provide me with exact details on how to reproduce this for a brand new Forem app?

@bodrovis
Copy link
Contributor

It seems that the default Forem's layout does not include jquery_ujs: https://github.com/radar/forem/blob/rails4/app/assets/javascripts/forem.js.erb

Therefore when you specify own layout (eg, application) it gets loaded and everything works fine.

@ivgames
Copy link

ivgames commented Sep 29, 2014

I've forked forem last friday, and merged it into spree application. After, i need to render forum inside spree application. I change layout in forem.rb to spree layout. After that i tried to delete one of created forums from admin panel, and saw error described above

@bodrovis
Copy link
Contributor

@RostDetal Yeah, seems that's the case.

@ivgames
Copy link

ivgames commented Sep 29, 2014

my forem config/initializers/forem.rb

Forem.user_class = "Spree::User"
Rails.application.config.to_prepare do
Forem.layout = Spree::Config.layout
Forem.email_from_address = "[email protected]"
Forem.per_page = 20
end

@radar
Copy link
Collaborator

radar commented Oct 11, 2014

Hi @RostDetal and @bodrovis, I'm still waiting for some exact steps to reproduce this in a new app. Please provide these.

@bodrovis
Copy link
Contributor

@radar Don't ask me :)) I was not getting this error but judging by the details it seems that ujs is the cause. Not sure though

@ivgames
Copy link

ivgames commented Oct 14, 2014

  1. Install clean rails APP
  2. install forem
  3. In APP initializer try to change layout for forem like a Forem.....layout = "application" outside
    Rails.application.config.to_prepare do ... end

@radar radar added this to the v1.0 milestone Jul 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants