[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Hello I've recently taken up programming more seriously

This is a red board which means that it's strictly for adults (Not Safe For Work content only). If you see any illegal content, please report it.

Thread replies: 6
Thread images: 2

File: 1481721244860s.jpg (5KB, 250x167px) Image search: [Google]
1481721244860s.jpg
5KB, 250x167px
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
>>
File: helpmepls.png (808KB, 1536x1006px) Image search: [Google]
helpmepls.png
808KB, 1536x1006px
>>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
Thread posts: 6
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.