Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails separate front & back

I've been using Ruby on Rails since a little more than one year now and I've always do it in a casual way, I mean, everything in one place (front & back), using the standard .html.erb file populated by the associated controller method.

Otherwise, today in our project, I have the need to separate the front and the back end for multiples reasons (code maintainability / clarity, better architecture, more reactivity, etc...).

I've done plenty of researches, watch some conferences (1, 2, 3), but didn't find my solution yet. It looks like to be a question that comes often, but what is the best practice/tools to separate the backend and the frontend of a Ruby on Rails app?

I don't feel we need (yet) a huge JS framework like React/EmberJS/Angular/etc...

First I was thinking about something like Middleman/Jekyll and make the communication via JSON and API calls, but it seems like that it's not a good solution for dynamic website.

So is there a frontend framework that works well with a Rails API and which is easily maintainable and upgradable (add feature/extension to it like gems)?

Thanks for your insights.

like image 309
ZazOufUmI Avatar asked Oct 10 '15 08:10

ZazOufUmI


1 Answers

A friend of mine wrote this great article/tutorial on Rails as a backend API.

http://blog.launchacademy.com/the-basics-of-building-an-api-in-ruby-on-rails/

As well as this tutorial on Rails/Ember.js

https://github.com/diegodesouza/Project-Planner-EmberJS

You can get an idea of how it's done and implement your preferred front end framework.

Hope it sheds some light on this question.

like image 148
Diego Avatar answered Nov 06 '22 18:11

Diego