R
R
rockdev2015-06-02 17:55:11
Ruby on Rails
rockdev, 2015-06-02 17:55:11

Is it a good idea to use eRuby(erb)?

I must say right away that I am not an expert in RoR, but I would like to know about eRuby (erb). If I understand correctly, then this is a technology that allows you to insert ruby ​​code directly into html. For some time I worked with Java and there is an analogue in the form of jsp. The problem that I potentially see is that the typical frontend developer is unlikely to understand anything in the code. You will also have to insert this ruby ​​code only after the design is done. What if the design changes significantly? Again, pull everything from above?
1) Is using eRuby a good idea?
2) Why not provide a convenient API and do everything with JS tools? Does one replace the other?
3) Is it possible to organize ajax using eRuby?
4) In what situations would eRuby be a better solution than JS?
5) Are there analogues of eRuby and what are their advantages?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Vsk, 2015-06-02
@viktorvsk

Analogues of erb - slim, haml (both depend on indentation, which has its pros and cons)
, all these things are called templating engines.
JS is not an alternative to them.
An alternative to them is to abandon HTML templates and transfer all data, say, to JSON, with which JS will already work (for example, one of the client-side template engines)
Frontends in rails are usually a full stack. Or pulls backendschik.
No one will save you from "overstretching", how do you imagine a template with logic, but without logic?
Rendering on the client or server side is also a separate, big, ambiguous issue.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question