Skip to content

Render with context#28

Open
aeberlin wants to merge 4 commits intoadorableio:masterfrom
aeberlin:render_with_context
Open

Render with context#28
aeberlin wants to merge 4 commits intoadorableio:masterfrom
aeberlin:render_with_context

Conversation

@aeberlin
Copy link

Anybody interested in helping me clean this up and get it merged?

The idea behind it is to allow the styleguide partials access to things outside of StyleguideController's view context (e.g. simple_form_for, internal helpers, etc) in order to allow styleguide partials to more closely represent their real-life usage.

Thoughts?

@aeberlin aeberlin force-pushed the render_with_context branch 2 times, most recently from bbf3c4c to 1bff927 Compare December 23, 2015 17:52
@aeberlin aeberlin force-pushed the render_with_context branch from 1bff927 to a97093c Compare December 23, 2015 17:54
@aeberlin
Copy link
Author

For example:

# config/initializers/woo.rb

  Rails.application.config.woo.view_contexts += [
    ::Rails.application.routes.url_helpers,
    ::ApplicationHelper,
  ]

Other things which plug in via ActionView extensions (e.g. simple_form) are automatically included, simply by passing a base context to .render in RenderHelper#render_haml_string.

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

Successfully merging this pull request may close these issues.

2 participants