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

Allow components to use application view helpers #3

Merged
merged 1 commit into from Jul 25, 2017
Merged

Allow components to use application view helpers #3

merged 1 commit into from Jul 25, 2017

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Jul 24, 2017

Previously a component that used it’s own app’s view helpers would error on the component guide with: undefined method

Note this does the opposite of a conventional gem: It needs things from the application to render views, rather than providing methods to an app.

https://trello.com/c/Wejsv8Lq/34-govuk-component-guide-must-load-in-helpers

Previously a component that uses it’s own app’s view helpers would
error on the component guide with: `undefined method`

* Add example of component using a helper
* Write test against component
* Include Rails.application.helpers in ApplicationController to make
those helper methods available when rendering the component through
this Engine:
https://stackoverflow.com/questions/9232175/access-main-app-helpers-when
-overridings-a-rails-engine-view-layout#comment44856151_19453140

Note this does the opposite of a conventional gem: It needs things from
the application to render views, rather than providing methods to an
app.
@nickcolley
Copy link
Contributor

@nickcolley nickcolley commented Jul 24, 2017

Epic 🚀

@fofr fofr merged commit 9cf155e into master Jul 25, 2017
1 check passed
1 check passed
continuous-integration/jenkins/branch This commit looks good
Details
@fofr fofr deleted the helpers branch Jul 25, 2017
fofr added a commit that referenced this pull request Jul 25, 2017
* Allow components to use application view helpers PR #3
@fofr fofr mentioned this pull request Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.