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

View and application helpers not available in a partial rendered from style guide #4

Open
robb1e opened this issue Jan 23, 2013 · 5 comments

Comments

@robb1e
Copy link

robb1e commented Jan 23, 2013

View helpers like 'user_path' and application helpers defined within our application are not available when the style guide calls a partial.

This is useful for larger components like what a comment block looks like, as it's made of several small components and we want to render these in one place.

Cheers

@dirkkelly
Copy link

Robbie, I forked and created StyleGuide::View specifically so that I could inject helper methods for forms.

I ended up removing the routes and replacing them with a method missing in StyleGuide::FormHelpers, you could as easily include the routes helpers instead.

notably:
dirkkelly@3e954f0#L3L1

@ohrite
Copy link
Collaborator

ohrite commented Sep 22, 2013

@robb1e @dirkkelly is this a change that should come into the main branch?

@davidbiehl
Copy link

I'd like to see this in the main branch as well. We define a lot of our own helpers, and to be able to use those in the styleguide would be awesome. Furthermore, when viewing the source in the styleguide, it would be nice to see the helper implementation instead of the raw HTML, if possible. That way any developer could see the style and know exactly how to implement it within the context of the project.

@dirkkelly
Copy link

@davidbiehl feel free to add a pull request for the raw helper, I can't imagine that being trivial.

@nmcclay
Copy link

nmcclay commented Feb 10, 2015

I created a pull request that I believe solves this issue: #16

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

No branches or pull requests

5 participants