Open vcavallo opened 10 years ago
@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?
@radar In the config/initializers/forem.rb file add:
Rails.application.config.to_prepare do Forem.layout = "application" end
That should fix it
Changing the links to buttons (link_to -> button_to) also works. More semantic too.
Also has same proble, and also changed forum layout
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
Can someone please provide me with exact details on how to reproduce this for a brand new Forem app?
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.
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
@RostDetal Yeah, seems that's the case.
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 = "please-change-me@example.com" Forem.per_page = 20 end
Hi @RostDetal and @bodrovis, I'm still waiting for some exact steps to reproduce this in a new app. Please provide these.
@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
Using:
When navigating to
/forums/admin/categories
and clicking "delete" for a category, this error is raised: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 inapp/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:
Gemfile: https://gist.github.com/vcavallo/8681c1fac0adac0a82df Gemfile.lock: https://gist.github.com/vcavallo/c5802edf54b563dff350