undefined method `render_elements'

16 views
Skip to first unread message

hopewise

unread,
Mar 20, 2015, 9:17:06 AM3/20/15
to alche...@googlegroups.com

After I have used the new alchemy repo:
gem 'alchemy_cms', github: 'AlchemyCMS/alchemy_cms', branch: 'master'


I got this error:

Showing /Users/Apple/Documents/projects/dcaclab-website/app/views/alchemy/page_layouts/_blogs.html.erb where line #53 raised:

undefined method `render_elements' for #<#<Class:0x007fbeed041e20>:0x007fbef260c3a0>
Extracted source (around line #53):
51
52
53
54
55
56
              
<!-- Main Blog Content -->
<div class="large-9 columns" role="content">
<%= render_elements only: 'blog_post' %>
</div>
<!-- End Main Content -->

Trace of template inclusion: app/views/home/home.html.haml

Rails.root: /Users/Apple/Documents/projects/dcaclab-website

Application Trace | Framework Trace | Full Trace
app/views/alchemy/page_layouts/_blogs.html.erb:53:in `_app_views_alchemy_page_layouts__blogs_html_erb___2540031086086667537_70229019383900'
actionview (4.2.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.0) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.0) lib/action_view/template.rb:143:in `render'
actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:339:in `render_partial'
actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:310:in `block in render'
actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:309:in `render'
actionview (4.2.0) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (4.2.0) lib/action_view/helpers/rendering_helper.rb:35:in `render'
haml (4.0.6) lib/haml/helpers/action_view_mods.rb:10:in `block in render_with_haml'
haml (4.0.6) lib/haml/helpers.rb:89:in `non_haml'
haml (4.0.6) lib/haml/helpers/action_view_mods.rb:10:in `render_with_haml'
app/views/home/home.html.haml:100:in `block in _app_views_home_home_html_haml__4253296109838495255_70228967581820'
haml (4.0.6) lib/haml/helpers.rb:368:in `call'
haml (4.0.6) lib/haml/helpers.rb:368:in `block in capture_haml'
haml (4.0.6) lib/haml/helpers.rb:608:in `with_haml_buffer'
haml (4.0.6) lib/haml/helpers.rb:364:in `capture_haml'
haml (4.0.6) lib/haml/helpers/xss_mods.rb:61:in `capture_haml_with_haml_xss'
haml (4.0.6) lib/haml/helpers/action_view_mods.rb:45:in `capture_with_haml'
actionview (4.2.0) lib/action_view/helpers/capture_helper.rb:152:in `content_for'
app/views/home/home.html.haml:25:in `_app_views_home_home_html_haml__4253296109838495255_70228967581820'
actionview (4.2.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.0) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.0) lib/action_view/template.rb:143:in `render'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (4.2.0) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.2.0) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.2.0) lib/action_view/rendering.rb:100:in `_render_template'
actionpack (4.2.0) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.2.0) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (4.2.0) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.2.0) lib/action_controller/metal/renderers.rb:37:in `render_to_body'
actionpack (4.2.0) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.2.0) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.2.0) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.2.0) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (4.2.0) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.0) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.0) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:234:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:234:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:92:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:92:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_process_action_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.0) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.0) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.0) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.2.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.0) lib/action_controller/metal.rb:236:in `block in action'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:42:in `serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:in `call'
meta_request (0.2.0) lib/meta_request/middlewares/app_request_handler.rb:11:in `call'
rack-contrib (1.2.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.2.0) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.2.0) lib/meta_request/middlewares/meta_request_handler.rb:13: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.6.0) lib/rack/etag.rb:24:in `call'
rack (1.6.0) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.0) lib/rack/head.rb:13:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.0) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.0) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
/Users/Apple/.rvm/gems/ext-ruby-2.2.1@dcaclab/bundler/gems/alchemy_cms-4a4a56692534/lib/alchemy/middleware/rescue_old_cookies.rb:10:in `call'
activerecord (4.2.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
request_store (1.1.0) lib/request_store/middleware.rb:8:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.0) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.0) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
dragonfly (1.0.7) lib/dragonfly/cookie_monster.rb:9:in `call'
rack (1.6.0) lib/rack/lock.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.0) lib/rack/sendfile.rb:113:in `call'
railties (4.2.0) lib/rails/engine.rb:518:in `call'
railties (4.2.0) lib/rails/application.rb:164:in `call'
railties (4.2.0) lib/rails/railtie.rb:194:in `public_send'
railties (4.2.0) lib/rails/railtie.rb:194:in `method_missing'
rack (1.6.0) lib/rack/deflater.rb:35:in `call'
rack (1.6.0) lib/rack/lock.rb:17:in `call'
rack (1.6.0) lib/rack/content_length.rb:15:in `call'
rack (1.6.0) lib/rack/handler/webrick.rb:89:in `service'
/usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/usr/local/Cellar/ruby/2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'

Thomas von Deyen

unread,
Mar 20, 2015, 9:39:24 AM3/20/15
to alche...@googlegroups.com
I assume the view is not rendered inside the Alchemy PagesController, right?

This seems to be the HomeController, right? You need to either inherit from Alchemy::PagesController
or you need to include Alchemy::ControllerActions in your HomeController.

best Thomas

--
You received this message because you are subscribed to the Google Groups "Alchemy CMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alchemy-cms...@googlegroups.com.
To post to this group, send email to alche...@googlegroups.com.
Visit this group at http://groups.google.com/group/alchemy-cms.
To view this discussion on the web visit https://groups.google.com/d/msgid/alchemy-cms/c33c0506-9620-43c2-a54e-8c2674bd5648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Samir Sabri

unread,
Mar 20, 2015, 9:55:30 AM3/20/15
to alche...@googlegroups.com
I am rendering alchemy/page_layouts/blogs.html.erb from a partial view that is rendered inside the application.html.haml
I am using the home_controller.rb :

class HomeController < ApplicationController

def home
home.html.haml 
end

end


home.html.haml :
#content{}
    .container
      .row
        .span12{:align=>"center"}
          =render "alchemy/page_layouts/blogs.html.erb"


How to include Alchemy::ControllerActions in HomeController ?


--
You received this message because you are subscribed to a topic in the Google Groups "Alchemy CMS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/alchemy-cms/e7Uplu-a3zI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to alchemy-cms...@googlegroups.com.

To post to this group, send email to alche...@googlegroups.com.
Visit this group at http://groups.google.com/group/alchemy-cms.

For more options, visit https://groups.google.com/d/optout.



--
--
Kind Regards,
--------------------------------------------- 
Samir Sabri
Software Architect& Developer
Jordan-Middle East

Thomas von Deyen

unread,
Mar 20, 2015, 11:22:26 AM3/20/15
to alche...@googlegroups.com
class HomeController < ApplicationController
  include Alchemy::ControllerActions
  ...

best Thomas


signature.asc

Samir Sabri

unread,
Mar 20, 2015, 2:46:30 PM3/20/15
to alche...@googlegroups.com
Thanks, it worked


For more options, visit https://groups.google.com/d/optout.

Thomas von Deyen

unread,
Mar 20, 2015, 3:38:00 PM3/20/15
to alche...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages