Abhishek.L February 2016

Rails-api and rendering html pages

I am using rails-api gem for an api project....

I have two or three webpages how do I do it SO that html will make an ajax call and consume JSONS

Where can I keep the html pages and render it..

Answers


max February 2016

Rails::API is a subset of a normal Rails application, created for applications that don't require all functionality that a complete Rails application provides. It is a bit more lightweight, and consequently a bit faster than a normal Rails application. The main example for its usage is in API applications only, where you usually don't need the entire Rails middleware stack nor template generation.

You can start adding middleware and subframeworks back to Rails-api - but then your turning your lean and mean racecar into a minivan.

A better solution may be to create a separate rails app which serves the HTML pages and has the full rails package.

Post Status

Asked in February 2016
Viewed 2,721 times
Voted 4
Answered 1 times

Search




Leave an answer