R
R
Robert2015-09-12 21:35:06
JavaScript
Robert, 2015-09-12 21:35:06

Application consisting of js.erb files?

Almost all of my controller actions only respond to js. Those. my application is, in fact, a set of js.erb files. It turns out a kind of SPA.
How correct is this approach? For I understand that if the application starts to grow, these js.erb files will become just, well, a lot.
And then there is another question. Should we take into account the fact that the user can disable JS in the browser? After all, then the whole application will fall.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CapeRatel, 2015-09-13
@CapeRatel

No need to bother. If your approach is a working site that covers your tasks, then I don’t see any problems.
As far as I understand, JS is rendered on the server, so disabled js in the browser will not put the site.
If you are afraid of a lot of js.erb files, then you can easily change to a lot of js.coffee files using any js framework.
PS All problems should be solved as they become available. Not earlier, not later.

_
_ _, 2015-09-13
@AMar4enko

CapeRatel
"As far as I understand JS is rendered on the server, so disabling js in the browser will not put the site."
The code is rendered, passed to the browser, executed in the browser. When the javascript is disabled, it will not be executed, so the site will "put" it down.
There is no profit from rendering js.erb on the server, you smear the logic, while still writing in JS. Give away data, do SPA.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question