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

Render with context #28

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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