Hello
I've recently taken up programming more seriously than Hello World in some common languages. I've created a web app in Ruby on Rails for training purposes but now I'd like to do the same thing with a Rails API. However I don't quite understand the concept and I don't know how to word the questions I have.
The web app approach was pretty straight forward. I used MVC pattern where controllers took the biggest hit to manipulate data and feed instance variables to the embedded ruby templates where some kind of front end framework (I used bootstrap) was used to make everything look alright.
Now my understanding is that using an API first approach (or a BaaS approach) means creating a RESTful API that responds to HTTP requests with a JSON message which is useful for portability of the project. What I don't understand is how is this API used by an application. For example when creating another web app but this time wanting to use the API, are the API and the application two different projects? How do I make API calls anyway? I want to create the entire application in rails/coffeescript. What is this pattern/architecture called? I still need to create a rails "backend" (in essence controllers) that makes calls to the API that I've created and maps responses to ruby objects to be show in the front end?
I've used simple external APIs before where I just need a URL and some kind of gem to create the request. I've never used "local" or self-made APIs before. Does the API exist in the same project as the code used to call the API and the rest of the front end etc?
TLDR: How to use a self-made rest api in rails to create a web application?
Any links on this topic very welcome
Thanks
>>4975603
did you look up what the return type of the .tostring method?
>>>/g/
fuggin' nerd
>>4976112
/g/entooman here
we dont want him either
>>4975603
I like that picture! Its funny and I sent it to all my friends!
>>4975603
Thats a nice picture