-
Notifications
You must be signed in to change notification settings - Fork 5
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
Using helpers inside builder #8
Comments
While I would have expected class DevelopmentCsv < Julia::Builder
extend ActionView::Helpers::DateHelper
column "Value" do |c|
time_ago_in_words c.created_at
end
end
DevelopmentCsv.build([Development.first])
#=> "Value\nabout 20 hours\n" I assume this has something to do with the DSL-style syntax, since other objects in my app (like presenters) which use standard method definition, include the functionality correctly using class EditPresenter < Burgundy::Item
include ActionView::Helpers::DateHelper
def time_ago
"#{time_ago_in_words(created_at)} ago"
end
end |
@dimoreira |
@beechnut @stevenbarragan Great guys. I will try Thanks |
How can one use a Rails helper inside the builder class?
I already tried to include the helper but this didn't work for me.
My example:
The text was updated successfully, but these errors were encountered: