简体   繁体   中英

private method `prepend' called for Refinery::Admin::PagesController:Class (NoMethodError)

I'm having an issue with heroku not running my app.

I'm using refinerycms and trying to put my nav menu in the footer per this tutorial .

I pushed everything to heroku successfully.

heroku run rake db:migrate worked fine.

When I try to open the app on heroku, I get this error in the logs:

/app/app/decorators/controllers/refinery/pages_controller.rb:1:in `<top (required)>': private method `prepend' called for Refinery::Admin::PagesController:Class (NoMethodError)

This is the file causing the error: pages_controller_decorator.rb

Refinery::Admin::PagesController.prepend(
  Module.new do
    def permitted_page_params
      super << :show_in_footer
    end
  end
)

Obviously heroku is having an issue with the prepend method, but I'm not sure how to make my footer action work without it.

There is an ability to call private methods in ruby using send . I am not sure, if this is intended to be used particularly here, but just change

Refinery::Admin::PagesController.prepend(MODULE_CODE)

to

Refinery::Admin::PagesController.send :prepend, MODULE_CODE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM