All threads / Can products like APPSUMO or Sumome be built using rails?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Can products like APPSUMO or Sumome be built using rails?

Masud Hossain asked in General

So say i wanna build a website widget where people can install it with a few lines of codes. And in that widget users are able to sign up for my website or see certain information that's on my website.

Is something like this possible to do on rails?

I'm fairly new to building API's or widgets (are they even the same thing?), so I'm trying to see how to go about learning these type of stuff.

EDIT: Correct me if I am wrong, but a website widget is basically someone else's website...within someones website. And you just use HTML/CSS to design it to look like a widget, and you use Javascript to do the API or GET/PULL requests. Right??

Absolutely! You need to do some interesting things for this, but I've built some JS embeds in the past. They're pretty fun.

For the most part you need to build a separate Javascript file (and stylesheet) that the users will embed and pass their custom data into (like your Google Analytics ID for example). The JS will need to run cross-origin which means that it may run on GoRails.com but it's code coming from Google analytics' domain and therefore it must be safe to send data to their domain. You'll need to read up on https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS and https://github.com/cyu/rack-cors in order to make the cross origin stuff work nicely.

They're probably not technically APIs, their more JS libraries you're building, but they will hit URLs in your app, that might be APIs. Since it's all your own JS, it's not really an API because an API is generally for other developers to consume, not yourself. It's a gray area because it's your code running on someone else's website though.

Thanks for the great response, Chris!

Is there any disadvantages to using Widgets over API's? Cause it seems to me that widgets are far more easier to install than certain API's.
So is Intercom.io considered an API or widget?

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,629+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.