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

Return value js should render the template, as documented, instead of serializing the second component #559

Merged
merged 1 commit into from
Jun 17, 2015
Merged

Return value js should render the template, as documented, instead of serializing the second component #559

merged 1 commit into from
Jun 17, 2015

Conversation

aherranz
Copy link
Contributor

No description provided.

@danikp
Copy link
Contributor

danikp commented Jun 17, 2015

Actually, i think mistake is in documentation. cause currently it states that sending {js, Vars} is same as {ok, Vars, ["Content-Type: application/javascript"]) and it does not make much sense from point of having additional option.
Current behavior provides an ability to return json without having template file at all and it's really useful option. For case you build some complex API, it could save creating dozens of template files

@aherranz
Copy link
Contributor Author

I do not understand why json is mentioned in your comment.

On my view, {js, Vars} as an alias of {ok, Vars, ["Content-Type: application/javascript"]} makes sense at least as a documentation resource ("this action serves javascript"). The problem is that it does not serve javascript but it directly outputs Vars (just in case Vars is a string, otherwise, it fails).

In my case, I am using this render to generate a javascripts used as table of translated strings for my front-end code.

@danikp
Copy link
Contributor

danikp commented Jun 17, 2015

my bad, there is {json, Vars} and {js, Vars} and I confused between them. Ok, {js, Vars} does not have much sense for me as a alias for {ok, Vars, ["Content-Type: application/javascript"]}, but if it exist, it should work as documented. Merging. Thanks.

danikp added a commit that referenced this pull request Jun 17, 2015
…template

Return value js should render the template, as documented, instead of serializing the second component
@danikp danikp merged commit 2386ca4 into ChicagoBoss:master Jun 17, 2015
@aherranz aherranz deleted the feature/js_value_to_render_the_template branch February 25, 2016 07:44
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