Rails rubies separate front and rear

I have been using Ruby on Rails since a little over one year, and I always do it randomly, I mean, all in one place (front and back), using a standard .html.erbfile filled with the controller method associated with it.

Otherwise, today in our project I have a need to separate the front and back for several reasons (ease of maintenance / clarity, better architecture, more responsiveness, etc.).

I did a lot of research, went through several conferences ( 1 , 2 , 3 ), but didn I haven't found my solution yet. This seems like a question that frequently arises, but what are the best practices / tools for separating the backend and the Ruby on Rails application interface?

I don't feel like we need a huge JS infrastructure like React / EmberJS / Angular / etc ...

At first I thought of something like Middleman / Jekyll and make a connection through JSON and API calls, but it seems like this is not a good solution for a dynamic website.

So, is there a frontend interface that works well with the Rails API and that is easily maintained and updated (add a function / extension to it like gems)?

Thanks for your ideas.

+4
source share
2 answers

I have a similar setup as one of the commentators on this.

I use Rails mainly for project structure, for defining page layouts and for ActiveRecord.

Then I have JSON APIs defined using the Grape API.

SPA, AngularJS, . , . Angular , , , SPA. , , Grunt, / JS/CSS , .

.

, , , .

0

Source: https://habr.com/ru/post/1611067/


All Articles