Joined March 2014
·
Achievements
106 Karma
8,966 Total ProTip Views
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Charity
Fork and commit to someone's open source project in need
Mongoose 3
Have at least three original repos where Ruby is the dominant language
Mongoose
Have at least one original repo where Ruby is the dominant language
thank you for your reply, about the superi-ing in the "constructor" we prevent using super in it because the extending class NewFolderView reference a "new" view, which means it has no Id or Name yet, it is a form with a "parentfolderid" only, we wanted it for a file-tree system so it became a need to have many extending classes for a folder like, EditFolderView, NewFolderView, etc...
about the @prototype... well, i have not found any problems on using it but yes @template_path would be accessed using it as a normal global variable and not prototypal like this:
this way we may not need to call it as:
as you say calling it with @prototype may have some issues but i have not found any yet, it may enlighten me if you could give me some info about problems using it.
EDIT
Correcting myself:
after trying the change in my answer 2 problems may colide:
if we add it as a global variable:
under the inherited @template method it would become unable to use the "newfoldertemplate" variable
TAKING A LOOK AT RENDERED JAVASCRIPT
is using refference to the class it is declared into (FolderView), when we see it in javascript it is:
and the template path prototypal variables are:
Now looking at the inherited javascript it has no @template function/method because the inheriting class relies in EXTENDING/INHERITING only.
then when we call:
the NewFolderView makes the function work in it's own scope, calling its own version of the template_ path under @template via the @prototype.template_ path