Skip to content

Return partial as engine with given view_path - #601

Merged
DouweM merged 1 commit into
nesquena:masterfrom
LTe:view-path-problem
Dec 5, 2014
Merged

Return partial as engine with given view_path#601
DouweM merged 1 commit into
nesquena:masterfrom
LTe:view-path-problem

Conversation

@LTe

@LTe LTe commented Dec 5, 2014

Copy link
Copy Markdown
Contributor

There was problem with view_path method. This method under normal
circumstances will returns @_view_path instance variable. Here comes
an interesting behavior of ruby

def view_path
   true
end

view_path = nil || view_path
view_path # => nil

Ruby will initialize non-existed local_variable and override the
method with the same name. So there is no way to create engine with
given view_path.

There was problem with `view_path` method. This method under normal
circumstances will returns `@_view_path` instance variable. Here comes
an interesting behavior of ruby

```ruby
def view_path
   true
end

view_path = nil || view_path
view_path # => nil
```

Ruby will initialize non-existed local_variable and override the
method with the same name. So there is no way to create engine with
given `view_path`.
@LTe

LTe commented Dec 5, 2014

Copy link
Copy Markdown
Contributor Author

Related #599

DouweM added a commit that referenced this pull request Dec 5, 2014
Return partial as engine with given view_path
@DouweM
DouweM merged commit 9804e08 into nesquena:master Dec 5, 2014
@DouweM

DouweM commented Dec 5, 2014

Copy link
Copy Markdown
Collaborator

Thanks, I prefer this implementation to that of #599. Merged!

@LTe

LTe commented Dec 5, 2014

Copy link
Copy Markdown
Contributor Author

@DouweM thanks!:-)

@LTe
LTe deleted the view-path-problem branch December 5, 2014 15:47
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