Hiccdown Development Notes
Showing only #303 and its comments.
See full discussionLog in or sign up to participate in this discussion.
With an account, you can revise, criticize, and comment on ideas.Discussions can branch out indefinitely. You may need to scroll sideways.
Dennis HackethalOP·#312··Criticism
That would be mixing class methods an instance methods in Rails helper modules, which typically only contain instance methods. Not idiomatic Rails usage.
Archived
Dennis HackethalOP·#332··Criticism
#327 applies here, too: no access to instance variables inside helper class methods.
Archived
Dennis HackethalOP·#305··Criticism
Does that mean they wouldn’t have access to the view_context? If so, calling helper methods from inside these class methods wouldn’t be possible.
Criticized1Archived
Dennis HackethalOP·#310··Criticism
If so, there might be a way to bind them to the view_context. Or I could definitely pass the view_context explicitly as the first parameter:
So instead of
ruby
@helper_module.instance_method(@action_name).bind_call(view_context)
I would do
ruby
@helper_module.send(@action_name, view_context)
And the parameter list of each Hiccdown method would start accordingly:
ruby
module ProductsHelperdef self.index vc #, …vc.some_helper_methodenddef some_helper_method# …endend
Archived