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

NoMethodError in Comfy::Admin::Cms::Layouts#new #1

Closed
zeitchef opened this issue Jan 30, 2018 · 8 comments
Closed

NoMethodError in Comfy::Admin::Cms::Layouts#new #1

zeitchef opened this issue Jan 30, 2018 · 8 comments

Comments

@zeitchef
Copy link

After installing Sofa, when I try to setup a new demo site I'm getting this error:

/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfy-blog-1e274e168364/app/views/comfy/admin/blog/partials/_navigation.html.haml:3:in `___sers_scott__rbenv_versions_______lib_ruby_gems_______bundler_gems_comfy_blog__e___e_______app_views_comfy_admin_blog_partials__navigation_html_haml__2859199240681814969_70336370845140'
actionview (5.2.0.beta2) lib/action_view/template.rb:159:in `block in render'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:170:in `instrument'
actionview (5.2.0.beta2) lib/action_view/template.rb:354:in `instrument_render_template'
actionview (5.2.0.beta2) lib/action_view/template.rb:157:in `render'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:344:in `block in render_partial'
actionview (5.2.0.beta2) lib/action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.2.0.beta2) lib/action_view/renderer/abstract_renderer.rb:43:in `instrument'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:333:in `render_partial'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:312:in `render'
actionview (5.2.0.beta2) lib/action_view/renderer/renderer.rb:49:in `render_partial'
actionview (5.2.0.beta2) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.2.0.beta2) lib/action_view/helpers/rendering_helper.rb:34:in `render'
haml (5.0.4) lib/haml/helpers/action_view_mods.rb:12:in `block in render'
haml (5.0.4) lib/haml/helpers.rb:92:in `non_haml'
haml (5.0.4) lib/haml/helpers/action_view_mods.rb:12:in `render'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/lib/comfortable_mexican_sofa/view_hooks.rb:14:in `block in render'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/lib/comfortable_mexican_sofa/view_hooks.rb:13:in `each'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/lib/comfortable_mexican_sofa/view_hooks.rb:13:in `render'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/app/helpers/comfy/admin/cms_helper.rb:24:in `cms_hook'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/app/views/layouts/comfy/admin/cms/_left.html.haml:31:in `___sers_scott__rbenv_versions_______lib_ruby_gems_______bundler_gems_comfortable_mexican_sofa__b____ededb__app_views_layouts_comfy_admin_cms__left_html_haml__2297145726797563825_70336313595920'
actionview (5.2.0.beta2) lib/action_view/template.rb:159:in `block in render'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:170:in `instrument'
actionview (5.2.0.beta2) lib/action_view/template.rb:354:in `instrument_render_template'
actionview (5.2.0.beta2) lib/action_view/template.rb:157:in `render'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:344:in `block in render_partial'
actionview (5.2.0.beta2) lib/action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.2.0.beta2) lib/action_view/renderer/abstract_renderer.rb:43:in `instrument'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:333:in `render_partial'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:312:in `render'
actionview (5.2.0.beta2) lib/action_view/renderer/renderer.rb:49:in `render_partial'
actionview (5.2.0.beta2) lib/action_view/helpers/rendering_helper.rb:37:in `render'
haml (5.0.4) lib/haml/helpers/action_view_mods.rb:12:in `block in render'
haml (5.0.4) lib/haml/helpers.rb:92:in `non_haml'
haml (5.0.4) lib/haml/helpers/action_view_mods.rb:12:in `render'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/app/views/layouts/comfy/admin/cms/_body.html.haml:6:in `___sers_scott__rbenv_versions_______lib_ruby_gems_______bundler_gems_comfortable_mexican_sofa__b____ededb__app_views_layouts_comfy_admin_cms__body_html_haml__2588287110193229650_70336358083500'
actionview (5.2.0.beta2) lib/action_view/template.rb:159:in `block in render'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:170:in `instrument'
actionview (5.2.0.beta2) lib/action_view/template.rb:354:in `instrument_render_template'
actionview (5.2.0.beta2) lib/action_view/template.rb:157:in `render'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:344:in `block in render_partial'
actionview (5.2.0.beta2) lib/action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.2.0.beta2) lib/action_view/renderer/abstract_renderer.rb:43:in `instrument'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:333:in `render_partial'
actionview (5.2.0.beta2) lib/action_view/renderer/partial_renderer.rb:312:in `render'
actionview (5.2.0.beta2) lib/action_view/renderer/renderer.rb:49:in `render_partial'
actionview (5.2.0.beta2) lib/action_view/helpers/rendering_helper.rb:37:in `render'
haml (5.0.4) lib/haml/helpers/action_view_mods.rb:12:in `block in render'
haml (5.0.4) lib/haml/helpers.rb:92:in `non_haml'
haml (5.0.4) lib/haml/helpers/action_view_mods.rb:12:in `render'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/app/views/layouts/comfy/admin/cms.html.haml:4:in `___sers_scott__rbenv_versions_______lib_ruby_gems_______bundler_gems_comfortable_mexican_sofa__b____ededb__app_views_layouts_comfy_admin_cms_html_haml__2336824977373826323_70336359075120'
actionview (5.2.0.beta2) lib/action_view/template.rb:159:in `block in render'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:170:in `instrument'
actionview (5.2.0.beta2) lib/action_view/template.rb:354:in `instrument_render_template'
actionview (5.2.0.beta2) lib/action_view/template.rb:157:in `render'
actionview (5.2.0.beta2) lib/action_view/renderer/template_renderer.rb:66:in `render_with_layout'
actionview (5.2.0.beta2) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (5.2.0.beta2) lib/action_view/renderer/template_renderer.rb:16:in `render'
actionview (5.2.0.beta2) lib/action_view/renderer/renderer.rb:44:in `render_template'
actionview (5.2.0.beta2) lib/action_view/renderer/renderer.rb:25:in `render'
actionview (5.2.0.beta2) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.2.0.beta2) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionview (5.2.0.beta2) lib/action_view/rendering.rb:84:in `render_to_body'
actionpack (5.2.0.beta2) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.2.0.beta2) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (5.2.0.beta2) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (5.2.0.beta2) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.2.0.beta2) lib/action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'
activesupport (5.2.0.beta2) lib/active_support/core_ext/benchmark.rb:14:in `block in ms'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
activesupport (5.2.0.beta2) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (5.2.0.beta2) lib/action_controller/metal/instrumentation.rb:46:in `block in render'
actionpack (5.2.0.beta2) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.2.0.beta2) lib/active_record/railties/controller_runtime.rb:31:in `cleanup_view_runtime'
actionpack (5.2.0.beta2) lib/action_controller/metal/instrumentation.rb:45:in `render'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/lib/comfortable_mexican_sofa/render_methods.rb:57:in `render'
/Users/scott/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/comfortable-mexican-sofa-9b4384ededb7/app/controllers/comfy/admin/cms/layouts_controller.rb:16:in `new'
actionpack (5.2.0.beta2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (5.2.0.beta2) lib/abstract_controller/base.rb:194:in `process_action'
actionpack (5.2.0.beta2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.2.0.beta2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (5.2.0.beta2) lib/active_support/callbacks.rb:132:in `run_callbacks'
actionpack (5.2.0.beta2) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (5.2.0.beta2) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (5.2.0.beta2) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.0.beta2) lib/active_support/notifications.rb:168:in `instrument'
actionpack (5.2.0.beta2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (5.2.0.beta2) lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
activerecord (5.2.0.beta2) lib/active_record/railties/controller_runtime.rb:24:in `process_action'
actionpack (5.2.0.beta2) lib/abstract_controller/base.rb:134:in `process'
actionview (5.2.0.beta2) lib/action_view/rendering.rb:32:in `process'
actionpack (5.2.0.beta2) lib/action_controller/metal.rb:191:in `dispatch'
actionpack (5.2.0.beta2) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (5.2.0.beta2) lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
actionpack (5.2.0.beta2) lib/action_dispatch/routing/route_set.rb:34:in `serve'
actionpack (5.2.0.beta2) lib/action_dispatch/journey/router.rb:52:in `block in serve'
actionpack (5.2.0.beta2) lib/action_dispatch/journey/router.rb:35:in `each'
actionpack (5.2.0.beta2) lib/action_dispatch/journey/router.rb:35:in `serve'
actionpack (5.2.0.beta2) lib/action_dispatch/routing/route_set.rb:830:in `call'
rack (2.0.3) lib/rack/etag.rb:25:in `call'
rack (2.0.3) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.3) lib/rack/head.rb:12:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/http/content_security_policy.rb:16:in `call'
rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/cookies.rb:663:in `call'
activerecord (5.2.0.beta2) lib/active_record/migration.rb:558:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (5.2.0.beta2) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.0.beta2) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.0.beta2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.0.beta2) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.0.beta2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.0.beta2) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.0.beta2) 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.0.beta2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.3) lib/rack/method_override.rb:22:in `call'
rack (2.0.3) lib/rack/runtime.rb:22:in `call'
activesupport (5.2.0.beta2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.0.beta2) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
railties (5.2.0.beta2) lib/rails/engine.rb:524:in `call'
puma (3.11.2) lib/puma/configuration.rb:225:in `call'
puma (3.11.2) lib/puma/server.rb:624:in `handle_request'
puma (3.11.2) lib/puma/server.rb:438:in `process_client'
puma (3.11.2) lib/puma/server.rb:302:in `block in run'
puma (3.11.2) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
@GBH
Copy link
Member

GBH commented Jan 30, 2018

Do you mind tell me the steps you took to arrive at this error? I'm a bit confused about "installing Sofa and setting up demo site". This repo already has everything setup so it's just a matter of:

  • git clone this_repo
  • bundle install
  • rails s

Error you're getting looks like missing routing helper or active_link_to missing. That should not happen.

@zeitchef
Copy link
Author

zeitchef commented Jan 30, 2018

Sorry, that wasn't clear. I started a fresh Rails installation beginning with Step 1 (I assumed this was a guided to setting up my own demo application, as implied in the opening paragraph).

@GBH
Copy link
Member

GBH commented Jan 30, 2018

That's right. So one thing I can think of is something going on in your routes.rb file. Mind posting what's in there?

@zeitchef
Copy link
Author

Sure, thing.

Rails.application.routes.draw do
  comfy_route :cms_admin, path: "/admin"
  # Ensure that this route is defined last
  comfy_route :cms, path: "/"
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end

@GBH
Copy link
Member

GBH commented Jan 30, 2018

Seems like you're missing blog routes. Should look something like this: https://github.com/comfy/comfy-demo/blob/master/config/routes.rb

@GBH
Copy link
Member

GBH commented Jan 31, 2018

Did that resolve your issue? Also I'm curious why blog routes didn't make it in. Blog generator should've put them in there,

@zeitchef
Copy link
Author

This corrected the issue for me. However, after adding the routes I could not name my site "Demo" (it complained that the hostname and identifier were already taken, which of course they could not have been).

I'm just a junior developer, so I won't presume to know here, but I noticed that Rails is automatically running rails active_storage:install during the initial rails new process. I believe this is also standard behavior for Rails 5.2. So to install Sofa, I needed to run the command again which perhaps the generator did not like?

Thanks again for all your effort on this project! It's my first experiments with a Rails CMS and I like it much better than the others I've found. Would you also consider PR's for the directions in the README? I'm a native English speaker and could make some very small suggestions that might help it read a little more naturally.

@GBH
Copy link
Member

GBH commented Jan 31, 2018

That's odd about hostname and identifier. That's only possible if there's already something in the database. Didn't know that active storage generator is being run during rails new. Maybe it's a recent change. Will keep an eye for it. It really doesn't affect anything though.

If you have suggestions in mind, feel free to submit PRs!

@zeitchef zeitchef closed this as completed Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants